Share via


EventList.Count Property

Visio Automation Reference

Returns the number of objects in a collection. Read-only.

Version Information
 Version Added:  Visio 2.0

Syntax

expression.Count

expression   A variable that represents an EventList object.

Return Value
Integer

Example

This Microsoft Visual Basic for Applications (VBA) macro shows how to use the Count property to iterate through a Documents collection. It displays the names of all the open Microsoft Office Visio documents in the Immediate window.

Visual Basic for Applications
  
Public Sub Count_Example()
 
    Dim intCounter As Integer
    Dim vsoDocument As Visio.Document 
For intCounter = 1 To Documents.Count 
    'Get the next open document.
     Set vsoDocument = Documents.Item(intCounter) 

    'Print its name in the Immediate window.
    Debug.Print vsoDocument.Name 
Next intCounter 

End Sub

See Also