ReplaceScope Property

Microsoft Publisher Visual Basic

Show All Show All

ReplaceScope Property

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

expression   Required. 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