Upravit

Sdílet prostřednictvím


Application.ActivePage property (Visio)

Returns the active Page object. Read-only.

Syntax

expression.ActivePage

expression A variable that represents an Application object.

Return value

Page

Remarks

The ActivePage property returns a Page object only when the active window displays a drawing page; otherwise, it returns Nothing. To verify that a page is active, use the Is operator to compare the ActivePage property with Nothing.

It is possible to get the active window without qualification from the Microsoft Visio global object, which is automatically available to VBA code that is part of the VBA project of a Visio document. For example, you can use this code:

Set vsoPage = ActivePage

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

  • Microsoft.Office.Interop.Visio.IVApplication.ActivePage

Example

This Microsoft Visual Basic for Applications (VBA) macro shows how to get the active page without qualification from the Visio global object, which is automatically available to VBA code that is part of the VBA project of a Visio document.

 
Public Sub ActivePage_Example() 
  
    Dim vsoPage As Page  
 
    'Find out if a page exists, and if it does, get the page. 
    If Not(ActivePage Is Nothing)  Then 
        Set vsoPage = ActivePage 
        Debug.Print vsoPage.Name 
    Else 
        Debug.Print "No active page." 
    End If   
 
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.