EventList 屬性 (Visio)EventList.Count property (Visio)

傳回集合中的物件數目。Returns the number of objects in a collection. 唯讀。Read-only.

語法Syntax

運算式計數expression.Count

_運算式_代表**EventList** 物件的變數。expression A variable that represents an EventList object.

傳回值Return value

整數Integer

範例Example

下列的 Microsoft Visual Basic for Applications (VBA) 宏會示範如何使用Count屬性來迴圈查看Documents集合。This Microsoft Visual Basic for Applications (VBA) macro shows how to use the Count property to iterate through a Documents collection. 它會在 [立即] 視窗中顯示所有開啟的 Microsoft Visio 檔案名稱。It displays the names of all the open Microsoft Visio documents in the Immediate window.

 
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

支援和意見反應Support and feedback

有關於 Office VBA 或這份文件的問題或意見反應嗎?Have questions or feedback about Office VBA or this documentation? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.