Consulting

Results 1 to 3 of 3

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

  1. #1

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

    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.

  2. #2
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    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)
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  3. #3

    Wink Thanks.

    " .Wrap = wdFindStop" works perfectly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •