Search and Select Question

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
 
G

Greg Maxey

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top