markh1182
06-22-2007, 01:56 AM
Hi,
I have an AutoText box with text in (obviously) and when I record a macro to find a phrase within that text it finds it ok. However, when I try to use this macro within another area it does not find the text.
What am I missing?
This is the code that was recorded:
Sub FindWords()
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Law Society"
.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 an AutoText box with text in (obviously) and when I record a macro to find a phrase within that text it finds it ok. However, when I try to use this macro within another area it does not find the text.
What am I missing?
This is the code that was recorded:
Sub FindWords()
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Law Society"
.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