Table of contents

Application.EventInfo 属性 (Visio)Application.EventInfo Property (Visio)

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

获取与事件相关联的其他信息(如果存在)。只读。Gets additional information associated with an event, if any exists. Read-only.


表达式EventInfo( eventSeqNum )expression . EventInfo( eventSeqNum )

表达式_一个表示应用程序对象的变量。_expression A variable that represents an Application object.


名称Name必需/可选Required/Optional数据类型Data Type说明Description
eventSeqNumeventSeqNum必需RequiredLongLongvisEvtIDMostRecent(0) 有关最近触发的事件或要检查的事件的序列号信息。visEvtIDMostRecent (0) for information about the most recently fired event, or the sequence number of the event to examine.

返回值Return Value



当 Microsoft Visio 将触发一个事件时,有少数几个事件为其提供了其他信息。这些活动是BeforeDocumentSaveAsDocumentSavedAsEnterScopeExitScopeMarkerEventShapesDeletedShapeChanged 。使用应用程序的EventInfo属性来获取此信息,如果有的话。When Microsoft Visio fires an event, there are a small number of events for which additional information is available. These events are BeforeDocumentSaveAs , DocumentSavedAs , EnterScope , ExitScope , MarkerEvent , ShapesDeleted , and ShapeChanged . Use the application's EventInfo property to obtain this information, when available.

EventInfo属性返回下列结果:The EventInfo property returns the following:

  • 如果事件记录额外信息,则返回一个字符串,其内容特定于所讨论的事件。A string whose contents are specific to the event in question, if the event does record extra information.

  • 如果事件不记录额外信息,则返回一个空字符串。An empty string if an event does not record extra information.

  • 如果 Visio 不再具有指定事件的信息,则返回一个错误。An error if Visio no longer has information for the specified event.

有关事件的EventInfo属性的内容的详细信息,请参阅特定的事件主题。For details about the contents of the EventInfo property for an event, see the specific event topic.

如果事件目标在触发后立即查询EventInfo属性,则最近的事件和其序列号传递给目标事件是相同的。但是,如果目标是由可执行 (.exe) 文件实现的加载项,这可能不是这种情况,因为可执行文件和 Visio 不会彼此模式的不同任务。If an event target queries the EventInfo property immediately after being triggered, the most recent event and the event whose sequence number was passed to the target are the same. However, if the target is an add-on implemented by an executable (.exe) file, this may not be the case, because the executable file and Visio are separate tasks that aren't modal with respect to each other.

请注意 (VBA) WithEvents关键字使用 Microsoft Visual Basic for Applications 的事件处理程序有权访问最近的事件,并且必须使用visEvtIDMostRecentNote Event handlers that use the Microsoft Visual Basic for Applications (VBA) WithEvents keyword have access to only the most recent event and must use visEvtIDMostRecent .

为了确保EventInfo属性所返回的信息是与同一事件触发加载项相关联,该可执行文件可以通过作为EventInfo属性的参数。您可以通过以下方式获取事件的序列号:To ensure that the information returned by the EventInfo property is associated with the same event that triggered the add-on, the executable file can pass as an argument to the EventInfo property. You can obtain the sequence number of an event in the following ways:

  • 如果事件对象的操作属性返回visActCodeRunAddon ,传递给该加载项的命令行字符串包含窗体的子字符串"/ eventid ="。If the Action property of the Event object returns visActCodeRunAddon , the command line string passed to the add-on contains a substring of the form "/eventid=".

    请注意 即使子字符串标记为"/ eventid,"不要混淆与触发事件的对象,用于标识事件在其事件列表集合中的对象的ID属性的命令行字符串中传递。传递的数字为实际触发序列号。Note Even though the substring is labeled "/eventid," don't confuse the passed in the command line string with the ID property of the firing Event object, which identifies the Event object in its EventList collection. The number being passed is actually the firing sequence number.

  • 如果事件对象的操作属性返回visActCodeAdvise ,序列号作为参数传递给目标对象实现的VisEventProc过程中。If the Action property of the Event object returns visActCodeAdvise , the sequence number is passed as an argument to the VisEventProc procedure implemented by the target object.
© 2018 Microsoft