RCinSTP
10-10-2012, 01:25 PM
I have some very simple VBA code below. One macro runs automatically when the document opens and the other runs automatically when the document is closed. The first sets the spell check property to False to indicate that spell check has not been run. When the document closes the message box should show that spell check has not been run "False" but instead it always switches it to True to indicate that spell check has been run. I want to prompt users when they close the document and ask if they ran spell check but I don't want to ask them if they already ran spell check.
Sub AutoOpen()
Application.ResetIgnoreAll
ActiveDocument.SpellingChecked = False
ActiveDocument.GrammarChecked = False
End Sub
Sub AutoClose()
Dim boSpellingChecked As Boolean
boSpellingChecked = ActiveDocument.SpellingChecked
MsgBox boSpellingChecked
End Sub
Sub AutoOpen()
Application.ResetIgnoreAll
ActiveDocument.SpellingChecked = False
ActiveDocument.GrammarChecked = False
End Sub
Sub AutoClose()
Dim boSpellingChecked As Boolean
boSpellingChecked = ActiveDocument.SpellingChecked
MsgBox boSpellingChecked
End Sub