Search and Select Question

  • Thread starter Thread starter GMLutz
  • Start date Start date
G

GMLutz

I use Word 2000.

I would like to select all text between the insertion point and a given
word above the insertin point. I think the answer is in the use of
wildcards, but I can't figure it out.

Thanks for the help.

George Lutz
 
GM,

AFAIK you can't find everything up to a word. You can find everything from
the insertion point up to and including a word.

Find: YourWord*

You will need to set Find>More options to search "Up" and "Use Wildcards."

You indicate that you want to select the text between the two point. If you
are selecting it for the purpose of deleting it. Then you could use
(YourWord)* in Find and \1 in Replace.

If you need the selection for something else then you could use a macro
something like:
Sub ScracthMacro()
Dim aWord As String
aWord = InputBox("Enter the anchor word.")
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = aWord & "*"
.Forward = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveStart Unit:=wdWord, Count:=1
End Sub
 
Back
Top