Row.EventList 屬性 (Visio)

會傳回物件的EventList集合,或包含 Event 物件的EventList集合。 唯讀。

語法

運算式EventList

表達 代表 Row 物件的變數。

傳回值

EventList

範例

這個 Microsoft Visual Basic for Applications (VBA) 巨集將示範如何使用 EventList 屬性將 Event 物件加入到 Document 物件的 EventList 集合中。 當加入圖形到文件中而觸發 Event 物件時,會執行您所指定的 VSL 附加元件。

在執行這個巨集之前,請將 fullpath\filenamefilename 的參照取代為 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 支援與意見反應