Application.EventList property (Visio)
Returns the EventList collection of an object or the EventList collection that contains an Event object. Read-only.
Syntax
expression.EventList
expression A variable that represents an Application object.
Return value
EventList
Example
This Microsoft Visual Basic for Applications (VBA) macro shows how to use the EventList property to add an Event object to the EventList collection of a Document object. When the Event object is triggered by adding a shape to the document, the VSL add-on that you specify runs.
Before running this macro, replace references to fullpath\filename
and filename
with a valid path and name for a Microsoft Visio VSL or executable (EXE) add-on.
Public Sub EventList_Example()
Dim vsoEventList As Visio.EventList
Dim vsoEvent As Visio.Event
Dim vsoAddons As Visio.Addons
Dim vsoAddon As Visio.Addon
'Prevent overflow error.
Const visEvtAdd% = &H8000
'Add the specified add-on to the Addons collection.
Set vsoAddons = Visio.Addons
Set vsoAddon = vsoAddons.Add ("fullpath\filename")
'Add a ShapeAdded event to the EventList collection
'of the document. The event will start the specified add-on, which
'should take no arguments.
Set vsoEventList = ThisDocument.EventList
Set vsoEvent = vsoEventList.Add(visEvtAdd + visEvtShape, visActCodeRunAddon, _
"filename", "")
End Sub
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 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기