傳回集合中的物件數目。 唯讀。
語法
表情。算
詞 一個代表 Section 物件的變數。
傳回值
整數
範例
這本Microsoft Visual Basic for Applications (VBA) 巨集 展示了如何使用 Count 屬性來遍歷 文件 集合。 它會在立即視窗中顯示所有已開啟的 Microsoft Visio 文件名稱。
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
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。