Disabling stencils from VBA

X

xargon

Hi everyone,

I have created a stencil with my predefined shapes. What I want to do is
not allow people to add any other shapes that the ones that are on this
stencil. So, I basically want to disable all other stencils and show only
my stencil in the stencil pane. Is there a way to do so from VBA? I was
thinking of doing it on Document load event.

Cheers!
xargon

P.S: Thanks to everyone who helped me over the last couple of days. I am
very new to Visio, VB and VBA and am learning a lot here!
 
A

Al Edlund

have you considered the easy way of making it readonly? disabling other
stencils does not remove their ability to draw and then insert from the
document.
al
 
X

xargon

Hi,

The problem is that I cannot make it readonly. I do want some shapes to be
drawn, but only the ones on the stencil that I create. What I would like to
do is disable people from using shapes other than the ones that I want.

Cheers!
xargon
 
A

Al Edlund

if the number of shapes is limited, you might consider testing the shapes
created event to make sure that they are your masters, if not delete the
shape.
al
 
C

Chris Roth [ Visio MVP ]

You can make shapes invisible.

doc.Masters("widget").visible = false

--

Hope this helps,

Chris Roth
Visio MVP
 

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