Selection.ClearFormatting method (Word)
Removes text and paragraph formatting from a selection.
Syntax
expression.ClearFormatting
expression A variable that represents a Selection object.
Example
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
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Váš názor
https://aka.ms/ContentUserFeedback.
Připravujeme: V průběhu roku 2024 budeme postupně vyřazovat problémy z GitHub coby mechanismus zpětné vazby pro obsah a nahrazovat ho novým systémem zpětné vazby. Další informace naleznete v tématu:Odeslat a zobrazit názory pro