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

Chapter 13. Generating Visio Drawings wi... > Dropping a Master on a Page

Dropping a Master on a Page

Now that you have a reference to the Master you want to use, you need just one more thing before you can drop that Master into your document. You need a reference to the page itself. The Pages collection object is a property of the Document object (remember you want the page of the drawing, not the Stencil). The Page object is referenced through the Item property of the Pages collection object, as shown in Listing 13.2.

Listing 13.2. Getting a Page Reference

Public Sub ReferenceThePage()
    Dim docsObj As Visio.Documents
    Dim docObj As Visio.Document
    Dim stnObj As Visio.Document
    Dim mastsObj As Visio.Masters
    Dim mastObj As Visio.Master
    Dim pagsObj As Visio.Pages
    Dim pagObj As Visio.Page
    Set docsObj = Visio.Documents
    Set docObj = docsObj.Add("Basic Flowchart.VST")
    Set stnObj = docsObj.Item("Basic Flowchart Shapes.vss")
    Set mastsObj = stnObj.Masters
    Set mastObj = mastsObj.Item("Process")
    Set pagsObj = docObj.Pages
    Set pagObj = pagsObj.Item(1)
    MsgBox pagObj.Name
End Sub


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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