Trap Page Insert/Delete Event

A

Asif

Hi all

I am using Visio 2003 Active X control in my application using VB.NET.

Is there any way to trap Page Insert/Delete event programmatically?

I need to trap it because if user deletes a page that is linked to some
shape on drawing the hyperlink information from that shape should also
removed.

Thanks a lot.

Asif
 
C

Chris [Visio MVP]

A Visio.Document object has these events:

BeforePageDelete
QueryCancelPageDelete
PageAdded
PageDeleteCanceled

"Query" allows you the chance to cancel the operation. "Before" allows you
to do your code before Visio finishes the operation.

You need to bridge from the Visio drawing control to the regular Visio
object model. You do this by looking at the Control's .Document or .Window
properties. Once you have these, then you're in the Visio world proper.

Ie:

Dim visDoc as Visio.Document = VisX.Document
dim visPage as Visio.Page = VisX.Window.Page
 
Top