ReplaceWith Property

Microsoft FrontPage Visual Basic

ReplaceWith Property

Sets or returns a String that represents the text to replace the text specified in the Find property.

expression.ReplaceWith

expression    Required. An expression that returns a SearchInfo object.

Example

The following example searches for all occurrences of lower case "the" and capitalizes the first letter.

    Dim objSearch As SearchInfo

Set objSearch = Application.CreateSearchInfo

objSearch.Action = fpSearchReplaceAllText
objSearch.Find = "the"
objSearch.Options = fpSearchMatchCase
objSearch.ReplaceWith = "The"

ActiveDocument.Find objSearch