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

Opening a Visio Stencil

You now have a new document based upon a specific template, and that template opened up both a new drawing page and one or more Stencils. The next thing you need to do is explicitly get a reference to the Stencil object so that you can work with the Masters on the Stencil. The documents collection has an Item property. The Item property can reference items within the Documents collection object either by integer (the sequence of the item within the collection) or explicitly by name. I will use the latter of these two methodologies to obtain a reference to a Stencil. Study the following example:

Public Sub ReferenceFlowchartStencil ()
        Dim docsObj As Visio.Documents
        Dim docObj As Visio.Document
        Dim stnObj As Visio.Document
        Set docsObj = Visio.Documents
        Set docObj = docsObj.Add("Basic Flowchart.VST")
        Set stnObj = docsObj.Item("Basic Flowchart Shapes.vss")
        Msgbox stnObj.Name
End Sub


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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