Index property (Page object)

Microsoft Visio Developer Reference

Index property (Page object)

   Example   

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

Version added

2002

Syntax

intRet = object.Index
object.Index = intExpression

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.

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.