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
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