Share via


ReplaceScope Property [Publisher 2003 VBA Language Reference]

Sets or returns a PbReplaceScope constant that specifies how many replacements are to be made: one, all, or none. Read/write PbReplaceScope.

PbReplaceScope can be one of these PbReplaceScope constants.
pbReplaceScopeAll
pbReplaceScopeNone
pbReplaceScopeOne

expression.ReplaceScope

expressionRequired. An expression that returns a FindReplace object.

Remarks

The default setting of the ReplaceScope property is pbReplaceScopeNone.

Example

The following example replaces all occurrences of the word "hi" with "hello" in the active document.

With ActiveDocument.Find
    .Clear
    .FindText = "hi"
    .ReplaceWithText = "hello"
    .MatchWholeWord = True
    .ReplaceScope = pbReplaceScopeAll
    .Execute
End With

Applies to | FindReplace Object