PDA

View Full Version : Solved: how to tell Word that I DON'T want to search/replace the remainder of the document



skulakowski
02-17-2005, 04:32 PM
It's late. I'm tired. I can't see the obvious.

I have a little search and replace macro that moves down 20 pages, selects all prior pages, and perfectly searches and replaces from here backwards to the top.

However, when I answered that I did NOT want to continue searching from this point forward, Word recorded

Selection.EscapeKey

This is not helping me. Word now insists that I click "No" to the "Do you want to search the remainder of the document?" every 20 pages.

Can somebody share with me the supersecret line of code that Word will accept as "No, I don't want to search the rest of the document. Really." so that I don't have to click "No" 400 times.

Thanks.

TonyJollans
02-18-2005, 12:07 AM
The Find object has a Wrap property. You probably have a line of code which says

.Wrap = wdFindAsk (I forget the exact keyword)

If you change this to

.Wrap = wdFindStop

I think you will be sorted

(Oh, and delete the Selection.EscpeKey line)

skulakowski
02-18-2005, 10:43 AM
" .Wrap = wdFindStop" works perfectly. :thumb