DrawingControl - How to load a stencil

P

Paul Wallis

Hi,
If I set the drawingcontrol.src to a file with a stencil then the stencil
opens correctly with the visio file, whic is great.
Anyone know how to load an additional stencil programatically ???

Cheers,
Paul Wallis
 
M

Matt

Hi Paul

You can load like a normal Visio.Document
That's I do it with the DC on an Access form:

======Code===
Dim visDocs As Visio.Documents
Dim visDoc As Visio.Document
Dim visStn As Visio.Document

Set visWin = myForm!DrawingControl1.Window
' hide "shape search" window in the loading stencils)
visWin.Windows.ItemFromID(Visio.visWinIDShapeSearch).Visible = False

Set visApp = visWin.Application
Set visDocs = visApp.Documents

'Load your template
Set visDoc = visDocs.Add("Path\mytemplate.vst")
' load your stencil
Set visStn = visApp.Documents("Path\mystencil.vss")

=====Code End=====

Hope this works for you
Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top