Abort shape deletion

D

dani

Hi there,

I'm building a database-editor with Visio.
I want to check whenever a user deletes a shape (catch the
BeforeShapeDelete event), if the shape may be deleted or not.
If not, the delete operation should be canceled.

thanx for help

Daniel
 
P

Peter Suter

Hi Dani

I propose you, to use "QueryCancelSelectionDelete"-Event.
This event fires, bevore ShapeDelete is executed.
You can evaluate the returned boolean value to stop Shape deletion.
Read Help.

Peter
 
J

John Marshall, MVP

BeforeShapeDelete is not used for aborting a deletion. It is used to collect
information from the shape(s) before they are deleted so that other actions,
like deleting associated shapes, can be performed.

Once you get to BeforeShapeDelete, you are commited to deletion.

Follow Peter's suggestion.

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