ApplyOutlineNumberDefault Method Example
This example adds outline numbering to the paragraphs in the selection. If the selection is already an outline-numbered list, the example removes the numbers and formatting.
Selection.Range.ListFormat.ApplyOutlineNumberDefault
This example sets the variable myRange
to include paragraphs three through six of the active document, and then it checks to see whether the range contains list formatting. If there's no list formatting, the default outline-numbered list format is applied.
Set myDoc = ActiveDocument
Set myRange = myDoc.Range( _
Start:= myDoc.Paragraphs(3).Range.Start, _
End:=myDoc.Paragraphs(6).Range.End)
If myRange.ListFormat.ListType = wdListNoNumbering Then
myRange.ListFormat.ApplyOutlineNumberDefault
End If