visEvtCodeExitScope

A

AVIDEO

I tried to create a event of the ExitScope with the VisUiCmd 1692 (Page is
Deleted).
I tried to create an event with addadvise, but when the event is SET it
gives an exception error.

I'am running VBA

My code look like this:

Option Base 1
Option Explicit

Public evtSink As clsEventSink

'Declare visEvtAdd as a 2-byte value to prevent a overflow
Private Const visEvtAdd% = &H8000

Public Sub CreateEventObjects()

Dim evtList As Visio.EventList
Dim vEvent As Visio.Event

'* Create an instance of the clsEventSink
If evtSink Is Nothing Then
Set evtSink = New clsEventSink
End If

'* Get the EventList collection
Set evtList = ActiveDocument.EventList

Set vEvent = evtList.AddAdvise(Visio.VisEventCodes.visEvtCodeExitScope,
evtSink, "", "")

End Sub

After the SET command the exception comes up.

What am i doing wrong.

Greetings, Ad
 
N

Nikolay Belyh

I think you should use Application's event list, not Document's event
list, because this event (visEvtCodeExitScope) is generated by
application. Means:

Set evtList = Application.EventList
 

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