Is there any way to start a MACRO, SEARCH (for a word, phrase or symbol),
begin a BLOCK, SEARCH AGAIN (for another word, phrase or symbol) and end the
BLOCK?
For example, in the above question, is there a way, within a MACRO, to:
SEARCH for the word "start".
Turn-on the beginning of a BLOCK.
SEARCH for the word "begin".
Then, End the BLOCK.
I should end up with the following phrase "highlighted" (i.e. blocked):
"start a MACRO, SEARCH (for a word, phrase or symbol), begin"
For some of my Reports I am still using WP5.1 because I can't figure-out how
to make WORD accomplish the above task! In WordPerfect it's easy--- within
the MACRO, you simply start and end a block with <alt>F4. Then, you can
move or copy the block anywhere you wish.
Your help in solving my problem is GREATLY appreciated!!!!
MWallace
Graham Mayor - 31 Dec 2003 17:50 GMT
You can use the wildcard replace functions to locate your required block of
text, which will thus be selected. See
http://www.mvps.org/word/FAQs/General/UsingWildcards.htm

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor - Word MVP
E-mail gmayor@mvps.org
Web site www.gmayor.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
> Is there any way to start a MACRO, SEARCH (for a word, phrase or
> symbol), begin a BLOCK, SEARCH AGAIN (for another word, phrase or
[quoted text clipped - 22 lines]
>
> MWallace
Jay Freedman - 31 Dec 2003 18:13 GMT
In Word the equivalent to WordPerfect's Block command (Alt+F4) is
called Extend, and the shortcut is F8 (or double-click the letters EXT
on the status bar). The macro recorder will record the shortcut.
In a macro, you could do this:
Selection.Collapse wdCollapseEnd
With Selection.Find
.ClearFormatting
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
With Selection
.Find.Execute FindText:="start"
.Extend
.Find.Execute FindText:="begin"
End With
An alternative would be to use the .Find properties of two Range
objects to find the start and end of the area you want, set the .End
of the first range equal to the .End of the second range, and then
.Select the resulting range.
>Is there any way to start a MACRO, SEARCH (for a word, phrase or symbol),
>begin a BLOCK, SEARCH AGAIN (for another word, phrase or symbol) and end the
[quoted text clipped - 19 lines]
>
>MWallace
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://www.mvps.org/word