Class Replacement (Word VBA)

The class Replacement represents the replace criteria for a find-and-replace operation. The properties and methods of the Replacement object correspond to the options in the Find and Replace dialog box.


To use a Replacement class variable it first needs to be instantiated, for example

Dim rpl as Replacement
Set rpl = Selection.Find.Replacement

Replacement class variables can be set using the Find.Replacement procedure.


The following procedures in this class have been grouped together and are described on a separate theme page

Format with its procedures ClearFormatting, Font, ParagraphFormat and Style


Frame returns a Frame object that represents the frame formatting for the specified style or find-and-replace operation.

Dim frmFrame As Frame
Set frmFrame = Selection.Find.Replacement.Frame

Highlight true if highlight formatting is applied to the replacement text.

Selection.Find.Replacement.Highlight =

LanguageID returns or sets a WdLanguageID constant that represents the language for the specified range.

Selection.Find.Replacement.LanguageID = wdAfrikaans

LanguageIDFarEast returns or sets an East Asian language for the specified replacement.

Selection.Find.Replacement.LanguageIDFarEast = wdAfrikaans

NoProofing true if Microsoft Word replaces text that the spelling and grammar checker ignores.

Selection.Find.Replacement.NoProofing =

Parent returns an object that represents the parent object of the specified Replacement object.

Dim objParent As Object
Set objParent = Selection.Find.Replacement.Parent

Text returns or sets the text to replace.

Selection.Find.Replacement.Text =