Cancel Delete

C

codequest

I've got an event procedure based on BeforeShapeDelete.

How can I cancel the delete, based on conditions that I test for in the
procedure?
 
J

John Marshall, MVP

codequest said:
I've got an event procedure based on BeforeShapeDelete.

How can I cancel the delete, based on conditions that I test for in the
procedure?

The purpose of the BeforeShapeDelete event is to handle cleanup before the
shape is deleted. At this point, it is too late to cancel the deletion.

The suggestion from Mark Nelson is to "Respond to the QueryCancelPageDelete
event and return True to cancel 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
 
J

JuneTheSecond

Me, too. How simple it is!
Private Function Document_QueryCancelSelectionDelete(ByVal Selection As
IVSelection) As Boolean
Document_QueryCancelSelectionDelete = True
End Function
 

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