PageIndex Property

Microsoft Publisher Visual Basic

expression.PageIndex

expression    Required. An expression that returns one of the objects in the Applies To list.

Remarks

A PageIndex property value is assigned to each page when it is added, and the value is incremented for each additional page. When pages are added or deleted, page index numbers are reassigned such that the first page is always 1 and the page index numbers always increment by 1. For example, in a publication with five pages, the page index numbers will be 1 through 5, regardless of the page number displayed on the pages themselves.

Example

The following example displays the PageIndex, PageNumber, and PageID properties for all the pages in the active publication.

Dim lngLoop As Long

With ActiveDocument.Pages
For lngLoop = 1 To .Count
With .Item(lngLoop)
Debug.Print "PageIndex = " & .PageIndex _
& " / PageNumber = " & .PageNumber _
& " / PageID = " & .PageID
End With
Next lngLoop
End With