E
EllenM
I am trying to extend a selection with a find via the following script.
Sub TEST_FIND()
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
End Sub
I have the following text in my document in which my cursor is at the open
square bracket .
[ Name of Recipient ]
When the script executes, only the closing square bracket is highlighted.
Essentially, I am trying to use the “extend†method to extend a selection
from the cursor’s position up to the point in the document where the
character or word you want to find is found.
Oddly enough I can get the script above to work using the Normal.dot profile
that someone gave me off their machine but can not get it to run with my own
Normal.dot profile. This leads me to believe I need to change some settings
in Word to obtain the same extend functionality. Any suggestions besides
using my friend's Normal.dot file?
Thanks in advance for your help,
Ellen
Sub TEST_FIND()
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
End Sub
I have the following text in my document in which my cursor is at the open
square bracket .
[ Name of Recipient ]
When the script executes, only the closing square bracket is highlighted.
Essentially, I am trying to use the “extend†method to extend a selection
from the cursor’s position up to the point in the document where the
character or word you want to find is found.
Oddly enough I can get the script above to work using the Normal.dot profile
that someone gave me off their machine but can not get it to run with my own
Normal.dot profile. This leads me to believe I need to change some settings
in Word to obtain the same extend functionality. Any suggestions besides
using my friend's Normal.dot file?
Thanks in advance for your help,
Ellen