Style.EventList 属性 (Visio)

返回对象的 EventList 集合或包含 Event 对象的EventList 集合。 此为只读属性。

语法

表达式EventList

表达 一个代表 Style 对象的变量。

返回值

EventList

示例

以下 Microsoft Visual Basic for Applications (VBA) 宏显示如何使用 EventList 属性将 Event 对象添加到 Document 对象的 EventList 集合中。 在通过向文档添加形状触发 Event 对象时,指定的 VSL 加载项将运行。

在运行此宏之前,请用 Microsoft Visio VSL 或可执行 (EXE) 加载项的有效路径和名称替换对 fullpath\filenamefilename 的引用。

 
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 支持和反馈,获取有关如何接收支持和提供反馈的指南。