Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Sep 2001
    Location
    Perth, Western Australia
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Suppressing confirmations in macros (Word '03)

    Hi all

    I got such helpful responses from my last post that I thought I'd pose another question (thanks to everyone!)

    I have recorded a little text replacement macro, which works a treat, except for the fact that every time I run it on a selection, it asks me if I want to process the rest of the document - and given the nature of the macro, the answer to that is a universal "No". For reasons that I'm sure make sense to folks more knowledgeable in such matters than me, the macro recorder never includes my "No" response to this prompt.

    I'd be very grateful if someone could give me a clue as to the magic line or 2 of code I need to add to the macro so that this "No" is passed through automatically.

    Thanks heaps

    Neil

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Suppressing confirmations in macros (Word '03)

    Set the Wrap argument of Find or Find.Execute to wdFindStop, e.g.

    With Selection.Find
    .Text = "red"
    .Replacement.Text = "blue"
    .MatchWholeWord = True
    .Wrap = wdFindStop
    .Execute Replace:=wdReplaceAll
    End With

  3. #3
    Star Lounger
    Join Date
    Sep 2001
    Location
    Perth, Western Australia
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Suppressing confirmations in macros (Word '03)

    Hans

    Thanks a lot - I figured it would be something simple - that's fantastic!!!!

    I love this place [img]/forums/images/smilies/smile.gif[/img]

    Have a great day

    Neil

Posting Permissions

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