Table of contents
TOC
Collapse the table of content
Expand the table of content

Document.Pages Property (Visio)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Returns the Pages collection for a document. Read-only.

Syntax

expression . Pages

expression A variable that represents a Document object.

Return Value

Pages

Remarks

If your Visual Studio solution includes the Microsoft.Office.Interop.Visio reference, this property maps to the following types:

  • Microsoft.Office.Interop.Visio.IVDocument.Pages

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
© 2017 Microsoft