Problem with function "Find and Replace" in Word.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I build a macro to auto "Find and replace" text in a document. In Word 2000,
it works very well. The problem is when i try to run the same macro in Word
2003. Actually it still working , but the problem is for each "Find and
replace" action the program will ask: do you want to go further will the find
action and there is two text find and replace ......etc. My question is, is
there a option in Word 2003 that you can turn off the question?

Thanks and Regards,
P.Law
 
Hi Pat,

Look in your macro code. If the .Wrap property of the .Find object is set to
wdFindAsk, that's the cause of the question. Change it according to the
behavior you want: wdFindContinue makes the search continue beyond the end
of the original selection or range (or wrap around to the beginning of the
document), or wdFindStop makes the search stop immediately.
 
Hi Jay,

Thanks for your help it seems be worked now. Another question the ".Wrap"
property, does it also be support by Word 2000. When i try to set this
property "Wrap" = wdFindAsk. And run the macro, it will automatisch find and
replace the text without asking any question.

Best regards,

Patrick
 
Hi Pat,

Yes, wdFindAsk does work in Word 2000. Whether or not the prompt
appears depends on how the replacement is set up -- if you tell it to
search the whole document, then there's nothing to ask about. That
happens when you're using Selection.Find and the Selection (the
cursor) starts at the beginning of the document, or if the whole
document is selected; or if you're using the .Find of a Range object
that's initialized to ActiveDocument.Range.

If you have any more questions of this sort, I'd suggest that you move
over to one of the programming/VBA newsgroups.
 

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

Back
Top