Application.QueueMarkerEvent method (Visio)
Queues a MarkerEvent event that fires after all other queued events.
Syntax
expression.QueueMarkerEvent (ContextString)
expression A variable that represents an Application object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
ContextString | Required | String | An arbitrary string that is passed with the event that fires. |
Return value
Long
Remarks
The QueueMarkerEvent method works in conjunction with the MarkerEvent event to allow an Automation client to queue an event to itself. The QueueMarkerEvent method causes the application to fire a MarkerEvent event after it has fired all the events in its event queue.
The QueueMarkerEvent method returns the sequence number of the MarkerEvent event to fire, and the string passed to the QueueMarkerEvent method (legally empty) is passed to the MarkerEvent event handler.
A client program can use either the sequence number or the string to correlate QueueMarkerEvent calls with MarkerEvent events. In this way, the client is able to distinguish events it caused and events it did not cause.
Example
Paste this example code into the ThisDocument object and then run the UseMarker procedure. The output will be displayed in the Microsoft Visual Basic for Applications (VBA) Immediate window.
Dim WithEvents vsoApplication As Visio.Application
Private Sub vsoApplication_MarkerEvent(ByVal app As Visio.IVApplication, _
ByVal SequenceNum As Long, ByVal ContextString As String)
Debug.Print "Marker: " & app.EventInfo(0)
End Sub
Private Sub vsoApplication_ShapeAdded(ByVal Shape As Visio.IVShape)
Debug.Print " ShapeAdded: " & Shape.Name
End Sub
Public Sub UseMarker()
Set vsoApplication = ThisDocument.Application
'Marker 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
The output in the VBA Immediate window looks like this:
Marker: I am starting...
ShapeAdded: Sheet.1
Marker: I am finished...
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기