How to trigger BeforeShapeDelete event?

Q

Qinghua

Hi,

I need to trigger the BeforeShapeDelete Event and add some codes inside.
Currently, I create a variable in ThisDocument object like the following:
Private WithEvents CurrentPage As Visio.Page

And in DocumentOpened event, I set the variable as follows:
Set CurrentPage = Application.ActivePage

However, when I delete a shape, it never jumps to the event sub:
Private Sub CurrentPage_BeforeShapeDelete(ByVal Shape As IVShape)

Is this the right way to use the event sub? I checked the msdn about
BeforeShapeDelete and it is said I need to use Add and AddAdvise to add the
event into the EventList. Is there a example?

Thanks!
Qinghua
 
J

JuneTheSecond

I think you are right.
You might chek QueryCancelSelectionDelete events, too.
 
A

Al Edlund

There are examples of how to use addadvise in the visio sdk available on
msdn.
Al
 

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