Table of contents

InvisibleApp.QueueMarkerEvent 方法 (Visio)InvisibleApp.QueueMarkerEvent Method (Visio)

office 365 dev account|上次更新日期: 2018/3/13
2 参与人员

所有其他排队的事件之后,将触发一个MarkerEvent事件进行排队。Queues a MarkerEvent event that fires after all other queued events.


表达式QueueMarkerEvent( ContextStringlpi4Ret )expression . QueueMarkerEvent( ContextString , lpi4Ret )

表达式_一个表示InvisibleApp对象的变量。_expression A variable that represents an InvisibleApp object.


名称Name必需/可选Required/Optional数据类型Data Type说明Description
ContextStringContextString必需RequiredStringString与触发的事件一起传递的任意字符串。An arbitrary string that is passed with the event that fires.

返回值Return Value



QueueMarkerEvent方法与MarkerEvent事件以允许自动化客户端队列事件本身一起工作。QueueMarkerEvent方法将导致应用程序触发MarkerEvent事件后激发的事件队列中的所有事件。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.

QueueMarkerEvent方法返回触发, MarkerEvent事件的序列号,并传递给QueueMarkerEvent方法 (法律空) 字符串传递到MarkerEvent事件处理程序。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.

客户端程序可以使用的序列号或字符串将调用QueueMarkerEventMarkerEvent事件相关联。以这种方式,客户端就能够区分它引起的事件和事件,它不会导致。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.


此示例代码粘贴到该状态报告对象并运行UseMarker过程。输出将显示在即时窗口中 (VBA) Microsoft Visual Basic for Applications。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

VBA 的“立即”窗口中的输出显示如下:The output in the VBA Immediate window looks like this:

Marker: I am starting...Marker: I am starting...

ShapeAdded: Sheet.1ShapeAdded: Sheet.1

Marker: I am finished...Marker: I am finished...

© 2018 Microsoft