S
Scott Parker
I used MS Word and recorded a macro which would find a specific word, in this case ?internet? and comment. However, if the word does not exist in the document then I get an error. Can anyone tell me how to add error handling or an IF statement?
' Find and Add Comment
'
Selection.Find.ClearFormatting
With Selection.Find
.Text = "internet"
.Replacement.Text = "internet"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = True
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Comments.Add Range:=Selection.Range
Selection.TypeText Text:="Capitalize Internet as the worldwide communication network"
EggHeadCafe - Software Developer Portal of Choice
C# Speech Recognition Stock Quote app with SAPI
http://www.eggheadcafe.com/tutorial...bd-7da8bfcd6bca/c-speech-recognition-sto.aspx
' Find and Add Comment
'
Selection.Find.ClearFormatting
With Selection.Find
.Text = "internet"
.Replacement.Text = "internet"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = True
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Comments.Add Range:=Selection.Range
Selection.TypeText Text:="Capitalize Internet as the worldwide communication network"
EggHeadCafe - Software Developer Portal of Choice
C# Speech Recognition Stock Quote app with SAPI
http://www.eggheadcafe.com/tutorial...bd-7da8bfcd6bca/c-speech-recognition-sto.aspx