Re: Why doesn't the Table object have an Index property by Jezebel
Jezebel
Thu Aug 26 17:10:38 CDT 2004
It's a result of the standard way Collections are managed in VB and VBA.
Each member of a collection has an Index and optionally a Key; however these
are properties of the *Collection* not of the item. The index is determined
by the item's current position in the collection, and changes if preceding
items are added or removed -- as you see happening with most of Word's
collections, like Tables(), Paragraphs(), Words().
The Index is not a property of the item itself because the item has no
control over its storage. You can have multiple collections containing the
same type of object; and one object can be a member of more than one
collection. In the case of a Table, if it had an Index property how would
you know if the index referred to its position within
ActiveDocument.Tables
ActiveDocument.Bookmark("MyBookMark").Tables
ActiveDocument.Application.Selection.Tables
Activedocument.Sections(2).Range.Tables
etc? The same table might be a member of all of these, with a different
index in each case.
"Raphael Goubet" <rgoubet@yahoo.fr> wrote in message
news:da59d264.0408260512.f40bf9a@posting.google.com...
> Hi,
>
> I'm wondering why the Table object does not have an Index property?
> This object belongs to a collection (Tables), so it should have one.
>
> What is the reason this object, just like Document or Paragraph does
> not have that property?
>
> Thanks in advance.
>
> Raph