atw: Re: Word macro help

  • From: Howard Silcock <howard.silcock@xxxxxxxxx>
  • To: "austechwriter@xxxxxxxxxxxxx" <austechwriter@xxxxxxxxxxxxx>
  • Date: Wed, 3 Dec 2014 11:25:42 +1100

Theoretically, when you use .Wrap = wdFindAsk, Word should *ask* you if you
want to continue to make the change beyond the end of y​our selection. (In
the online documentation for WdFindWrap it says "wdFindask: After searching
the selection or range, Microsoft Word displays a message asking whether to
search the remainder of the document".) But this seems to be another case
where Microsoft's theory and practice are at odds.

Howard

On 3 December 2014 at 10:54, Geoffrey <geoffrey@xxxxxxxxxxxxxx> wrote:

> Howard, you’re a marvel. Many thanks.
>
>
>
> Geoffrey Marnell
>
> Principal Consultant
>
> Abelard Consulting Pty Ltd
>
> P: 03 9596 3456
>
> M: 0419 574 668
>
> F: 03 9596 3625
>
> Web: www.abelard.com.au
>
>
>
> *From:* austechwriter-bounce@xxxxxxxxxxxxx [mailto:
> austechwriter-bounce@xxxxxxxxxxxxx] *On Behalf Of *Howard Silcock
> *Sent:* Wednesday, 3 December 2014 10:06 AM
> *To:* austechwriter@xxxxxxxxxxxxx
> *Subject:* atw: Re: Word macro help
>
>
>
> Try replacing .Wrap = wdFindAsk with .Wrap = wdFindStop
>
>
>
> ​Howard
>
>
>
> On 3 December 2014 at 09:23, Geoffrey <geoffrey@xxxxxxxxxxxxxx> wrote:
>
> Hi austechies
>
>
>
> I’m stuck with a Word macro. All I want to do is have = replaced by &amp;=
> in a selection of text. This is the code that the record macro command
> generates:
>
>
>
> Sub equals()
>
> '
>
> ' equals Macro
>
> '
>
> '
>
>     With Selection.Find
>
>         .ClearFormatting
>
>         .Replacement.ClearFormatting
>
>         .Text = "="
>
>         .Replacement.Text = "&amp;="
>
>         .Forward = True
>
>         .Wrap = wdFindAsk
>
>         .Format = False
>
>         .MatchCase = False
>
>         .MatchWholeWord = False
>
>         .MatchWildcards = False
>
>         .Execute Replace:=wdReplaceAll
>
> End With
>
> End Sub
>
>
>
> The problem is that this macro replaces = with &amp;= throughout the
> entire rest of the document, not just in the text selected. That’s not what
> I want.
>
>
>
> Any ideas?
>
>
>
>
>
> Geoffrey Marnell
>
> Principal Consultant
>
> Abelard Consulting Pty Ltd
>
> P: 03 9596 3456
>
> M: 0419 574 668
>
> F: 03 9596 3625
>
> Web: www.abelard.com.au
>
>
>
>
>

Other related posts: