MarkerEvent help Example failure

R

rhatcher

Im trying to learn about event markers, using the following example
from the VBA help file. I do not get the expected output. the middle
line "ShapeAdded: Sheet.1" does not shpw up and I cannot figure out
what is causing the problem. Any help will be appreciated.

COPIED FROM THE HELP FILE:

This example shows how to use the MarkerEvent event to mark an event in
the event queue.

Paste this example code into the ThisDocument code window and then run
UseMarker. The output will be displayed in the Immediate window.

The output in the Immediate window looks like this:

Marker: I am starting...

ShapeAdded: Sheet.1

Marker: I am finished...



Dim WithEvents vsoApplication As Visio.Application

Private Sub vsoApplication_MarkerEvent(ByVal app As
Visio.IVApplication, _
ByVal lngSequenceNum As Long, ByVal strContextString As String)
Debug.Print "Marker: " & app.EventInfo(0)

End Sub

Private Sub appVisio_ShapeAdded(ByVal vsoShape As Visio.IVShape)
Debug.Print " ShapeAdded: " & Shape.Name

End Sub

Public Sub UseMarker()

Set vsoApplication = ThisDocument.Application

'MarkerEvent events can be used to comment a segment
'of events in the queue.
vsoApplication.QueueMarkerEvent "I am starting..."
ActivePage.DrawRectangle 0, 0, 3, 3
vsoApplication.QueueMarkerEvent "I am finished..."

End Sub
 
A

Al Edlund

I don't see a "with events" definition for the appVisio, did you code one?
You've got vsoApplication and appVisio events.

al
 
R

rhatcher

No Al, I did not, I was just following the help instructions.
Apparently I did not have the prerequisite knowledge to read that
example.

But thanks to you I know what to look at next ;)
 

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