RemoveNumbers Method

Microsoft Word Visual Basic

Show All

RemoveNumbers Method

       

Removes numbers or bullets from the specified Document, List, or ListFormat object.

expression.RemoveNumbers(NumberType)

expression   Required. An expression that returns one of the objects in the Applies To list.

NumberType  Optional WdNumberType. The type of number to be removed.

Can be one of the following WdNumberType constants.
wdNumberParagraph
wdNumberListNum
wdNumberAllNumbers
The default value is wdNumberAllNumbers

Remarks

When this method is applied to a List object, it removes numbers only from paragraphs in the specified list, skipping over any interleaved numbers from other lists. If this method is applied to the ListFormat object for a range of text, all numbers from all lists in the range are removed.

Example

As it applies to the ListFormat object.

This example removes the bullets or numbers from any numbered paragraphs in the selection.

Selection.Range.ListFormat.RemoveNumbers

This example removes the LISTNUM fields from the selection.

Selection.Range.ListFormat.RemoveNumbers wdNumberListNum

As it applies to the Document object.

This example removes the numbers from the beginning of any numbered paragraphs in the active document.

ActiveDocument.RemoveNumbers wdNumberParagraph

This example removes the bullets or numbers from the third list in MyDocument.doc.

If Documents("MyDocument.doc").Lists.Count >= 3 Then
    Documents("MyDocument.doc").Lists(3).RemoveNumbers
End If