How to select text in between two "finds"

  • Thread starter Thread starter Dennis Q. Wilson
  • Start date Start date
D

Dennis Q. Wilson

Hi. I'm having a hard time figuring out how to do this, and hope
someone here can explain it to me.

Let's say I have a paragraph with the word "franks" somewhere near the
top and the word "beans" somewhere below it. How can I get the program
(either Word XP or Word 2003) to find and select all text in between
those two points?

Thanks to anyone who can dispel the darkness.
 
Hi, Dennis! I was amazed to find out what it did....
See that little EXT at the bottom of Word's window? You must be viewing your
status bar to see it.
1. Do your find for franks and close the dialog
2. Double-click EXT
3. Do your find for beans
Voila!
************
Hope it helps!
Anne Troy
www.OfficeArticles.com
 
Anne said:
Hi, Dennis! I was amazed to find out what it did....
See that little EXT at the bottom of Word's window? You must be viewing your
status bar to see it.
1. Do your find for franks and close the dialog
2. Double-click EXT
3. Do your find for beans
Voila!
************
Hope it helps!
Anne Troy

It did! Thank you very much!
 
Just for Info - F8 will do the same as clicking on EXT

Or you can search for franks*beans if you have use wildcards checked
 
Dennis,

Your question is answered. However, if you wanted to selected the text
between those two points excluding the terms themselves then I think
only a macro would do. Sometime like:

Sub FRTest()
Dim firstTerm As String
Dim secondTerm As String
Dim myRange As Range
Dim selRange As Range
Set myRange = ActiveDocument.Range
firstTerm = InputBox("Enter first term to find:")
secondTerm = InputBox("Enter second term to find:")
With myRange.find
.Text = firstTerm
.MatchWholeWord = True
.Execute
myRange.Collapse direction:=wdCollapseEnd
Set selRange = ActiveDocument.Range
selRange.Start = myRange.End
.Text = secondTerm
.MatchWholeWord = True
.Execute
myRange.Collapse direction:=wdCollapseStart
selRange.End = myRange.Start
selRange.Select
End With
End Sub
 
Back
Top