Format related procedures in class Replacement (Word VBA)

This page presents procedures from class Replacement related to the theme Format: ClearFormatting, Font, ParagraphFormat and Style


Removes text and paragraph formatting from the text specified in a replace operation.

Sub ClrFmtgReplace() 
 Dim rngTemp As Range 
 Set rngTemp = ActiveDocument.Content 
 With rngTemp.Find 
 .MatchWholeWord = True 
 .Execute FindText:="Inc.", ReplaceWith:="incorporated", _ 
 End With 
End Sub


Returns or sets a Font object that represents the character formatting of the specified object.

To set this property, specify an expression that returns a Font object.

Selection.Find.Replacement.Font =


Returns or sets a ParagraphFormat object that represents the paragraph settings for the specified replacement operation.

With ActiveDocument.Content.Find 
 .Execute FindText:="", ReplaceWith:="", _ 
End With


Returns or sets the style for the specified style. To set this property, specify the local name of the style, an integer, a WdBuiltinStyle constant, or an style that represents the style. Read/write Variant.

When you return the style for a range that includes more than one style, only the first character or paragraph style is returned.

Selection.Find.Replacement.Style =