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

ClearFormatting

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 
 .ClearFormatting 
 .Replacement.ClearFormatting 
 .MatchWholeWord = True 
 .Execute FindText:="Inc.", ReplaceWith:="incorporated", _ 
 Replace:=wdReplaceAll 
 End With 
End Sub

Font

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 =

ParagraphFormat

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

With ActiveDocument.Content.Find 
 .ClearFormatting 
 .ParagraphFormat.Space2 
 .Replacement.ClearFormatting 
 .Replacement.ParagraphFormat.Space15 
 .Execute FindText:="", ReplaceWith:="", _ 
 Replace:=wdReplaceAll 
End With

Style

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 =