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

Shape.PersistsEvents 属性 (Visio)Shape.PersistsEvents Property (Visio)

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

指示一个对象是否能够包含永久事件在其事件列表集合中。只读的。Indicates whether an object is capable of containing persistent events in its EventList collection. Read-only.

语法Syntax

表达式PersistsEventsexpression . PersistsEvents

表达式_一个表示一个Shape对象的变量。_expression A variable that represents a Shape object.

返回值Return Value

IntegerInteger

注解Remarks

每个对象都具有一个事件列表属性也有一个PersistsEvents属性。若要持久,事件操作代码必须是visActCodeRunAddon ,但它也必须在其PersistsEvents属性为True对象的事件集合。目前仍然存在的事件的唯一对象是文档文档和页面的对象。Every object that has an EventList property also has a PersistsEvents property. To be persistable, an event's action code must be visActCodeRunAddon , but it must also be in the EventList collection of an object whose PersistsEvents property is True . The only objects that currently persist events are Document , Master , and Page objects.

是否持久事件实际上 does 保持取决于其持续属性的值。Whether a persistable event actually does persist depends on the value of its Persistent property.

示例Example

(VBA) 宏此 Microsoft Visual Basic for Applications 演示了如何使用PersistsEvents属性来确定对象是否能够包含持久事件。执行宏打印 1 ( True )、 1 ( True ),并且 0 ( False )即时窗口中的文档窗口对象,分别。This Microsoft Visual Basic for Applications (VBA) macro shows how to use the PersistsEvents property to determine if an object is capable of containing persistent events. Executing the macro prints 1 ( True ), 1 ( True ), and 0 ( False ) in the Immediate window for the Document , Page , and Window objects, respectively.


Public Sub PersistsEvents_Example() 

 Dim vsoDocument As Visio.Document 

 Set vsoDocument = Documents.Add("") 
 Debug.Print vsoDocument.PersistsEvents 
 Debug.Print ActivePage.PersistsEvents 
 Debug.Print ActiveWindow.PersistsEvents 

End Sub
© 2018 Microsoft