_Document.CountNumberedItems(Object, Object) 方法

定义

返回指定对象中的项目符号或编号项和 LISTNUM 域的数目。Returns the number of bulleted or numbered items and LISTNUM fields in the specified object.

public int CountNumberedItems (ref object NumberType, ref object Level);
abstract member CountNumberedItems : obj * obj -> int
Public Function CountNumberedItems (Optional ByRef NumberType As Object, Optional ByRef Level As Object) As Integer

参数

NumberType
Object

可选对象Optional Object. 要进行计数的编号类型。The type of numbers to be counted. 可以是下列 WdNumberType 常量之一: wdNumberParagraphwdNumberListNumwdNumberAllNumbersCan be one of the following WdNumberType constants: wdNumberParagraph, wdNumberListNum, or wdNumberAllNumbers. 默认值是 wdNumberAllNumbersThe default value is wdNumberAllNumbers.

Level
Object

可选对象Optional Object. 与要计数的编号级别相对应的数。A number that corresponds to the numbering level you want to count. 如果省略该参数,将计算所有级别的数目。If this argument is omitted, all levels are counted.

返回

Int32

注解

指定wdNumberParagraphwdNumberAllNumbers (默认值)时,将对项目符号项进行计数 NumberTypeBulleted items are counted when either wdNumberParagraph or wdNumberAllNumbers (the default) is specified for NumberType.

有两种类型的数字:预设号码(wdNumberParagraph),您可以通过在 "项目符号和编号" 对话框中选择模板来添加到段落中。和 LISTNUM 域(wdNumberListNum),允许您为每个段落添加一个以上的数字。There are two types of numbers: preset numbers (wdNumberParagraph), which you can add to paragraphs by selecting a template in the Bullets and Numbering dialog box; and LISTNUM fields (wdNumberListNum), which allow you to add more than one number per paragraph.

适用于