CountNumberedItems Method
Collapse the table of content
Expand the table of content

Document.CountNumberedItems Method (Object, Object)


Returns the number of bulleted or numbered items and LISTNUM fields in the document.

Namespace:   Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

int CountNumberedItems(
	ref object NumberType,
	ref object Level


Type: System.Object

The type of numbers to be counted. Can be one of the following T:Microsoft.Office.Interop.Word.WdNumberType values: F:Microsoft.Office.Interop.Word.WdNumberType.wdNumberParagraph, F:Microsoft.Office.Interop.Word.WdNumberType.wdNumberListNum, or F:Microsoft.Office.Interop.Word.WdNumberType.wdNumberAllNumbers. The default value is F:Microsoft.Office.Interop.Word.WdNumberType.wdNumberAllNumbers.

Type: System.Object

A number that corresponds to the numbering level you want to count. The default is that all levels are counted.

Return Value

Type: System.Int32

The number of bulleted or numbered items and LISTNUM fields in the document.

Bulleted items are counted when either F:Microsoft.Office.Interop.Word.WdNumberType.wdNumberParagraph or F:Microsoft.Office.Interop.Word.WdNumberType.wdNumberAllNumbers (the default) is specified for NumberType.

There are two types of numbers: preset numbers (F:Microsoft.Office.Interop.Word.WdNumberType.wdNumberParagraph), which you can add to paragraphs by selecting a template in the Bullets and Numbering dialog box; and LISTNUM fields (F:Microsoft.Office.Interop.Word.WdNumberType.wdNumberListNum), which enable you to add more than one number per paragraph.

For information on optional parameters, see Optional Parameters in Office Solutions.

Return to top
© 2016 Microsoft