I created code which launches spell check, and of the user clicks close or cancel, and spelling errors are greater than 0, spell check instantly re-opens. The code works fine, however, I have noted that occasion when clicking close of cancel, the code crashes- it jumps ahead of the loop and spell check closes. I have no idea why. The section of code concerned is as follows:
Do
If Dialogs(wdDialogToolsSpellingAndGrammar).Show = -1 Then
Dialogs(wdDialogToolsSpellingAndGrammar).Show
End If
Loop Until ActiveDocument.SpellingErrors.Count = 0 And ActiveDocument.GrammaticalErrors.Count = 0
It's a literally a matter of clicking close say 9 times and the code loops, but on the 10th click the problem occurs. Nothing else is done, so I don't see why this happens.