Muokkaa

Jaa


Document.Pages property (Visio)

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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.