Share via


Application.EventInfo Property

Visio Automation Reference

Gets additional information associated with an event, if any exists. Read-only.

Version Information
 Version Added:  Visio 4.0

Syntax

expression.EventInfo(eventSeqNum)

expression   A variable that represents an Application object.

Parameters

Name Required/Optional Data Type Description
eventSeqNum Required Long visEvtIDMostRecent (0) for information about the most recently fired event, or the sequence number of the event to examine.

Return Value
String

Remarks

When Microsoft Office 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.

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.
  • An error if Microsoft Office Visio no longer has information for the specified event.

For details about the contents of the EventInfo property for an event, see the specific event topic.

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.

ms425727.vs_note(en-us,office.12).gif  Note
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.

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 <sequence number> as an argument to the EventInfo property. You can obtain the sequence number of an event in the following ways:

  • 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=<sequence number>".
    ms425727.vs_note(en-us,office.12).gif  Note
    Even though the substring is labeled "/eventid," don't confuse the <sequence number> 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.
  • 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.

See Also