PersistsEvents Property [Visio 2003 SDK Documentation]
Indicates whether an object is capable of containing persistent events in its EventList collection.
intRet = object**.PersistsEvents**
intRet Integer. False (0) if this object cannot contain persistent events; True (1) if it can.
object Required. An expression that returns an object in the Applies to list.
Version added
4.1
Remarks
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.
Whether a persistable event actually does persist depends on the value of its Persistent property.
Example
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
Applies to | Application object | Cell object | Characters object | Document object | Documents collection | InvisibleApp object | Layer object | Layers collection | Master object | Masters collection | Page object | Pages collection | Row object | Section object | Selection object | Shape object | Shapes collection | Style object | Styles collection | Window object | Windows collection
See Also | EventList collection | Persistable property | Persistent property