返回集合中对象的数目。 此为只读属性。
语法
表达式。计数
expression:一个表示 Shapes 对象的变量。
返回值
长型
示例
以下 Microsoft Visual Basic for Applications (VBA) 宏显示如何使用 Count 属性遍历 Documents 集合。 该宏在“即时”窗口中显示所有打开的 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 支持和反馈,获取有关如何接收支持和提供反馈的指南。