Share via


Index Property [Visio 2003 SDK Documentation]

As it applies to the Addon, Document, Event, Font, Layer, Master, MasterShortcut, Row, Section, and Window objects.

Gets the ordinal position of an object in a collection.

intRetobject**.Index**

intRet = object**.Index**

object.Index =intExpression

intRet     Integer. The index of the object within its collection.

object     Required. An expression that returns an object in the Applies to list.

Version added

2.0

Remarks

Most collections are indexed starting with 1 rather than zero (0), so the index of the first element is 1, the index of the second element is 2, and so forth. The index of the last element in a collection is the same as the value of that collection's Count property. You can iterate through a collection by using these index values. Adding objects to or deleting objects from a collection can change the index values of other objects in the collection.

As it applies to the Color, Connect, Menu, MenuItem, Shape, Style, Toolbar, and ToolbarItem objects.

Gets the ordinal position of an object in a collection.

intRet = object**.Index**

intRet     Long. The index of the object within its collection.

object    Required. An expression that returns an object in the Applies to list.

Version added

2.0

Remarks

Most collections are indexed starting with 1 rather than zero (0), so the index of the first element is 1, the index of the second element is 2, and so forth. The index of the last element in a collection is the same as the value of that collection's Count property. You can iterate through a collection by using these index values. Adding objects to or deleting objects from a collection can change the index values of other objects in the collection.

There are some exceptions. The Colors collection is indexed starting with 0. This is consistent with the numbering displayed next to the colors that appear in the Color Palette dialog box (on the Tools menu, click Color Palette ).

These collections are also indexed starting with 0: AccelItems, AccelTables, MenuSets, MenuItems, Menus, ToolbarItems, Toolbars, and ToolbarSets.

As it applies to the Page object.

Gets or sets the ordinal position of a page in a Pages collection.

intRet    Integer. The index of the page within its collection.

object     Required. An expression that returns a Page object.

intExpression    Required Integer. The new index of a page within its collection.

Version added

2002 (In earlier versions, the Index property of the Page object was read-only.)

Remarks

The Pages collection is indexed starting with 1 rather than zero (0), so the index of the first element is 1, the index of the second element is 2, and so on. The index of the last element in a collection is the same as the value of that collection's Count property. You can iterate through a collection by using these index values. Adding objects to or deleting objects from a collection can change the index values of other objects in the collection.

You may only assign a new index to a foreground page. Background pages are unordered. Use the Background property to determine if a given page is a background page.

Use the BackPage property to assign a background page to a foreground page or to another background page.

Applies to | Addon object | Color object | Connect object | Document object | Event object | Font object | Layer object | Master object | MasterShortcut object | Menu object | MenuItem object | Page object | Row object | Section object | Shape object | Style object | Toolbar object | ToolbarItem object | Window object