Table of contents
TOC
折叠目录
展开目录

Section.EventList 属性 (Visio)Section.EventList Property (Visio)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

返回的对象的事件列表集合或包含Event对象的事件集合。只读的。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 a Section object.

返回值Return Value

事件列表EventList

示例Example

此 Microsoft Visual Basic for Applications (VBA) 宏显示如何使用事件属性来将事件对象添加到文档对象的事件集合。通过向文档添加一个形状触发事件的对象时,您指定的 VSL 加载项运行。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 you specify runs.

运行此宏之前,引用替换为_fullpath\filename_和_文件名_有效的路径和 Microsoft Visio VSL 或可执行文件 (EXE) 加载项的名称。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 specifed add-on, which 
 'should take no arguments. 
 Set vsoEventList = ThisDocument.EventList 
 Set vsoEvent = vsoEventList.Add(visEvtAdd + visEvtShape, visActCodeRunAddon, _ 
 "filename ", "") 

End Sub
© 2018 Microsoft