A
alex
Hi all,
I tried to do a search in VBA with the following code,
but cound not, the message I got is
running time error '449'
Argument not optional
What is wrong with my setting?, Thanks
Code:
Do Until wrdDoc.Bookmarks("\Sel") = _
wrdDoc.Bookmarks("\EndOfDoc")
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "COMPANY:"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
If Selection.Find.Found = True Then
MsgBox "found"
Else
Exit Do
End If
Loop
I tried to do a search in VBA with the following code,
but cound not, the message I got is
running time error '449'
Argument not optional
What is wrong with my setting?, Thanks
Code:
Do Until wrdDoc.Bookmarks("\Sel") = _
wrdDoc.Bookmarks("\EndOfDoc")
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "COMPANY:"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
If Selection.Find.Found = True Then
MsgBox "found"
Else
Exit Do
End If
Loop