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 I have highlighted the collections in the diagrams of these objects.
Note
I have also formatted the output in the following code examples as a table for legibility, because the text will mostly wrap within the Immediate Window.
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 sub-function 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 Debug.Print , "COMAddIns.Count", .COMAddIns.Count Debug.Print , "CurrentEdition",...