Unwanted dialog box in Replace macro

N

Nucular

I recorded a macro to remove all spaces from selected text, using the Replace
command. When it finishes it asks me if I want to search the remainder of the
document. Is there any way to prevent this box from coming up?
 
H

Helmut Weber

Hi Nucular,

set
..Wrap = wdFindStop

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
N

Nucular

Thanks, Helmut. I found in the macro the command: .Wrap=wdFindAsk. In a
similar macro that I made several years ago, by recording, there was the
command: .Wrap=wdFindContinue , and this did not give the dialog box.
However, I didn't program this macro, I recorded it. Of course, I don't
remember the details of that recording. Do you know if there is a preference
somewhere in MS Word that will make the Continue as a default? I really
don't want to do editing for this, since I am writing an article to help
users make such a macro on their machines. Nucular
 
H

Helmut Weber

Hi Nucular,
Do you know if there is a preference
somewhere in MS Word that will make the Continue as a default?

sorry, if I may say so: no idea.
I don't think there is a setting for that.

On the other hand, "continue" as default,
would be very problematic.


--
Gruß

Helmut Weber, MVP WordVBA

"red.sys" & chr$(64) & "t-online.de"
Win XP, Office 2003 (US-Versions)
 
N

Nucular

Hi Helmut - well, I did some more digging in Office Help. Under "Tips for
recording a macro" it says:
• If the macro includes the Edit menu command Find or Replace, click More
in the Find tab, and then click All in the Search box. If the macro searches
up or down only, Word stops the macro when it reaches the beginning or end of
the document and displays a message asking whether you want to continue
searching.

What this means is that if you DON'T have All selected, and only have it
search up or down, it WILL stop and ask about continuing the search. When I
selected All (what I must have done 3 years ago!), it used Continue in the
wrap command and did not put up a dialog box.

Thanks again for your help. Nucular
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top