PageDelete event

E

eddie

When a user delete a page, Is there a way to determine the name of the page that its going to be deleted?
 
A

Al Edlund

you have to enable events with something like this

Private WithEvents pagObj As Visio.Page

then turn them on when the document opens

Public Sub Document_DocumentOpened(ByVal doc As IVDocument)
Set pagObj = Visio.ActivePage
End sub


and then finally I use something like this..

Private Function pagObj_QueryCancelPageDelete(ByVal Page As IVPage) As
Boolean
If LCase(Page.Name) = "project definition" Then
MsgBox "This page (Project Definition) should not be deleted"
End If
End Function

hope this helps ,
Al


eddie said:
When a user delete a page, Is there a way to determine the name of the
page that its going to be deleted?
 
Top