Given a document with the following text:
The quick brown fox jumped high.
There is a cat over the lazy dog.
The quick brown fox jumped.
There is a bird over the lazy dog.
How can I write a macro to delete the text between ‘jumped’ and ‘over’ so
the document ends up like:
The quick brown fox jumped over the lazy dog.
The quick brown fox jumped over the lazy dog.
The following macro finds the end of ‘jumped’:
Sub FindFoxyJump()
Selection.Find.ClearFormatting
With Selection.Find
.Text = "jumped"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub
Specifically how can one begin a selection from that location, and extend it
to the beginning of ‘over’? While it is simple to select text by moving the
cursor with
Selection.MoveDown Unit:=wdLine, Count:=2, Extend:=wdExtend
There seems to be no such Extend:=wdExtend argument for
Selection.Find.Execute.
Please help. I am really stuck.

Signature
Regards,
-Ron
Greg Maxey - 27 Jan 2005 22:34 GMT
You don't need a macro.
Edit Find>Replace>More>Use Wildcards
Type (jumped)space<high*bird>space(over) in the find what field
Type \1space\2 in the replace with field and press replace all
Note replace "space" with a single space.

Signature
Greg Maxey/Word MVP
A Peer in Peer to Peer Support
> Given a document with the following text:
> The quick brown fox jumped high.
[quoted text clipped - 34 lines]
>
> Please help. I am really stuck.
RNEELY - 27 Jan 2005 23:33 GMT
Thanks Greg. That is a cool feature.
> You don't need a macro.
>
[quoted text clipped - 42 lines]
> >
> > Please help. I am really stuck.