• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 13. Generating Visio Drawings wi... > Creating a Visio Document

Creating a Visio Document

Now that you have your reference to the Application object (whether explicitly or implicitly), the next step down the Object Model hierarchy is a reference to the Documents collection object and then to the document. Keep in mind that if you use CreateObject() to create a new instance of Visio, the documents collection in a new Visio instance will contain zero members. You will then need to use the Add method of the Documents collection object to create the Visio drawing.

If Visio is running, the Count property of the Documents collection object will return the number of open documents in the running instance of Visio. Remember that because the Automation call is creating an object reference, you must explicitly use the SET keyword when binding the return to the reference. Here is an example of getting a reference to the first (and presuming only) open document in the running instance of Visio:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint