C
Charlie Mac
I am using this code to detect specific grammar errors (e.g. starting
a sentence with 'However...') and all works well until it nears the
end of a document. Near the end of a document two identical comments
are generated for each error. The length of the document does not
seem to matter. If 30 errors are detected, about 4 or 5 of the last
ones will have duplicated comments. The loop is needed to scan the
entire document for multiple copies of the same error. Any ideas are
appreciated. Thanks.
Bray(eye,1) = "However"
Bray(eye,2) = "Avoid starting a sentence with 'However'"
Do While Selection.Find.Execute(FindText:=Bray(Eye, 1), Forward:=True,
Format:=True) = True
Selection.Comments.Add Range:=Selection.Range, Text:=Bray(Eye, 2)
Loop
a sentence with 'However...') and all works well until it nears the
end of a document. Near the end of a document two identical comments
are generated for each error. The length of the document does not
seem to matter. If 30 errors are detected, about 4 or 5 of the last
ones will have duplicated comments. The loop is needed to scan the
entire document for multiple copies of the same error. Any ideas are
appreciated. Thanks.
Bray(eye,1) = "However"
Bray(eye,2) = "Avoid starting a sentence with 'However'"
Do While Selection.Find.Execute(FindText:=Bray(Eye, 1), Forward:=True,
Format:=True) = True
Selection.Comments.Add Range:=Selection.Range, Text:=Bray(Eye, 2)
Loop