Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Document.Pages Property (Visio)

Published: July 16, 2012

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

Version Added: Visio 2.0

expression .Pages

expression A variable that represents a Document object.

Return Value

Pages

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

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 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.