Page Method

Returns an instance of the Page object that corresponds to the page with the specified index in the page collection of the document.

Applies to: Document object

Syntax

[[Set] pageRet =] object.Page ( index )

The Page method syntax has these parts:

Part Description
object Required. An expression, that returns an instance of the Document object.
index

Required. An expression that returns a Long value. Indicates the index of the page in the page collection of the document.

pageRet Optional. A Page type variable.

Remarks

If index is less than 1 or greater than the number of pages in the page collection of the document, the Page method returns Nothing. Use the PagesNum method to find out the number of pages in the page collection of the document. .

Example

This example contains a document-level script. The program displays all page names and properties of each page in the page collection of the document. The Page method is used to go through all pages in the collection.

' Declare variables
Dim ppage As Page


' Loop through all pages of the document
' by using the Page method
For i=1 To thisDoc.PagesNum()


    ' Get next page from the pae collection
    ' of the document
    Set ppage = thisDoc.Page(i)

    ' Display the page index
    TRACE "Page_#_" & i
    ' выводим на экран свойства страницы
    TRACE "    ID = " & ppage.ID
    TRACE "    Name = " & ppage.Name
    TRACE "    isBackground = " & ppage.isBackground
    TRACE "    BackPageID = " & ppage.BackPageID

Next i

 

See Also

AddPage method, FindPage method, PageByID method, PagesNum method, RemovePage method, RemovePageByID method, ReorderPage method, ReorderPageByID method, Page object