Share via


Pages Property [Visio 2003 SDK Documentation]

Returns the Pages collection for a document.

objsRet = object**.Pages**

objsRet     The Pages collection for a document.

object     Required. An expression that returns a Document object.

Version added

2.0

Example

This Microsoft Visual Basic for Applications (VBA) macro shows how to use the Pages property to print the names of a document's pages.

Public Sub Pages_Example()
 
    Dim intCounter As Integer
    Dim vsoDocument As Visio.Document 
    Dim vsoPages As Visio.Pages 

    'Get the Pages collection for the active document. 
    Set vsoPages = ActiveDocument.Pages
 
    Debug.Print "Page names for document: "; ActiveDocument.Name
 
    'Iterate through the pages and print the page name 
    'in the Immediate window. 
    For intCounter = 1 To vsoPages.Count 
        Debug.Print " "; vsoPages.Item(intCounter).Name 
    Next intCounter 

End Sub

Applies to | Document object

See Also | Document object | Pages collection