I want to record a "find & replace" macro that applies only to text that is
highlighted when the macro is run. How do you disable or avoid this
automatic message: "Word has finished searching the selection. [Some # of]
replacements were made. Do you want to search the remainder of the document?"

In other words, how do I convince the macro recorder that I highlighted that
text to set limits -- not just a temporary stopping point -- to the "find &
replace" process?

I don't care if the message appears during the recording process, but I want
to avoid it when the macro is run. The purpose of a macro is to automate
some process with a single key stroke. The "continue searching" message just
adds a further step (hitting the "no" button), and several such steps if the
macro includes multiple "find & replace" actions.

By the way, WordPerfect, Version 8, didn't have this problem.

--
cmmnctng

RE: "continue searching" message when recording a "find & replace" mac by rhamrecitationcom

rhamrecitationcom
Wed Oct 19 17:31:04 CDT 2005

Your macro when you go into the VB Editor probably looks something like this-

With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
End With

Where it says ".Wrap = wdFindContinue" change that to ".Wrap = wdFindStop"

That should do it.

-Ryan

"cmmnctng" wrote:

> I want to record a "find & replace" macro that applies only to text that is
> highlighted when the macro is run. How do you disable or avoid this
> automatic message: "Word has finished searching the selection. [Some # of]
> replacements were made. Do you want to search the remainder of the document?"
>
> In other words, how do I convince the macro recorder that I highlighted that
> text to set limits -- not just a temporary stopping point -- to the "find &
> replace" process?
>
> I don't care if the message appears during the recording process, but I want
> to avoid it when the macro is run. The purpose of a macro is to automate
> some process with a single key stroke. The "continue searching" message just
> adds a further step (hitting the "no" button), and several such steps if the
> macro includes multiple "find & replace" actions.
>
> By the way, WordPerfect, Version 8, didn't have this problem.
>
> --
> cmmnctng