John... Visio MVP - Question on Masters/Instances

R

Russ McKenna

I have read your posting on similiar posts, so -

I know of a simple reference from a shape to it's local master. Is there any
way to get a reference from a local master to it's instance?

I want to remove unused local masters.
Is the only way to cycle through all the shapes in a drawing and remembering
the master as used. Then going through the masters and deleting those that
are not used?

Can you try to delete a master, and intercept the msg "this will
sever.......", so abort. If you do not get the msg, it is okay to delete the
master?

I know of products that will do this, but I need to own the code.
 
J

John Marshall, MVP

When you manually delete a master from the local stencil, a warning message
appears indicating the master is used. You should be able to delete the
masters and abort if the message appears. Of hand I can not remember which
event to put the code in, but it is not the Before Delete event. With the
Before Delete event you are already committed to deleting the shape, the
event only provides an opportunity to do some cleanup before the shape is
gone. It can not be used to abort the deletion.


John... Visio MVP

Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm
Need VBA examples? http://www.mvps.org/visio/VBA.htm
Common Visio Questions http://www.mvps.org/visio/common_questions.htm
 

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