Understanding the Visio object model
We will now examine some of the key properties of the main objects in the Visio Type Library. Please note that the collections have been highlighted in the diagrams of these objects.
Note
The output text that is displayed within the Immediate window has been formatted as a table for legibility in the following code examples.
Examining the Application object
The Application object is the root of most collections and objects in Visio, including the Active objects, two of which are useful for traversing structured diagrams—ActiveDocument and ActivePage.
The following subfunction in VBA prints out the salient information to the Immediate window:
Public Sub DebugPrintApplication()
Debug.Print "DebugPrintApplication"
With Visio.Application
Debug.Print , "ActiveDocument.Name", .ActiveDocument.Name
Debug.Print , "ActivePage.Name", .ActivePage.Name
Debug.Print , "Addons.Count", .Addons.Count...