Selection.ClearFormatting Method (Word)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Removes text and paragraph formatting from a selection.

expression .ClearFormatting

expression A variable that represents a Selection object.

This example removes all text and paragraph formatting from the active document.

Sub ClrFmtg() 
 ActiveDocument.Select 
 Selection.ClearFormatting 
End Sub

This example removes all text and paragraph formatting from the second through the fourth paragraphs of the active document.

Sub ClrFmtg2() 
 ActiveDocument.Range(Start:=ActiveDocument.Paragraphs(2).Range.Start, _ 
 End:=ActiveDocument.Paragraphs(4).Range.End).Select 
 Selection.ClearFormatting 
End Sub
Show: