CanvasShapes.Count 属性 (Word)

返回一个 Long 类型的值,该值代表指定集合中画布图形的数量。 此为只读属性。

语法

表达式计数

expression 是必需的。 一个代表 CanvasShapes 对象的变量。

示例

本示例显示活动文档的段数。

MsgBox "The active document contains " & _ 
 ActiveDocument.Paragraphs.Count & " paragraphs."

本示例显示选定内容的字数。

If Selection.Words.Count >= 1 And _ 
 Selection.Type <> wdSelectionIP Then 
 MsgBox "The selection contains " & Selection.Words.Count _ 
 & " words." 
End If

本示例用 aFields() 数组来储存活动文档中的域代码。

fcount = ActiveDocument.Fields.Count 
If fcount >= 1 Then 
 ReDim aFields(fcount) 
 For Each aField In ActiveDocument.Fields 
 aFields(aField.Index) = aField.Code.Text 
 Next aField 
End If

另请参阅

CanvasShapes 集合

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。