Visio (的 Application.EventList 屬性)
會傳回物件的EventList集合,或包含 Event 物件的EventList集合。 唯讀。
語法
運算式。EventList
expression 代表 Application 物件的變數。
傳回值
EventList
範例
這個 Microsoft Visual Basic for Applications (VBA) 巨集將示範如何使用 EventList 屬性將 Event 物件加入到 Document 物件的 EventList 集合中。 當 Event 物件透過將圖形新增至檔來觸發時,您指定的 VSL 附加元件會執行。
在執行此宏之前,請將 和 的 fullpath\filename
filename
參考取代為 Microsoft Visio VSL 的有效路徑和名稱,或是 EXE) 附加元件 (可執行檔。
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
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。