MS word: a macro to turn ON/OFF some proofing settings
What macro could turn ON/OFF some proofing settings? (Unfortunately macro recording doesn't record the setting change)
I'm looking for a way to turn ON/OFF 2 proofing settings (at the same time):
- check spelling as you type
- mark grammar errors as you type
Solution 1:
Application.Options.CheckGrammarAsYouType & .CheckSpellingAsYouType is what you're looking for.
Example:
Sub GrammarSpellingOn()
Application.Options.CheckGrammarAsYouType = True
Application.Options.CheckSpellingAsYouType = True
End Sub
Sub GrammarSpellingOff()
Application.Options.CheckGrammarAsYouType = False
Application.Options.CheckSpellingAsYouType = False
End Sub
To turn ON/OFF using the same macro, with a popup stating the change done:
Sub GrammarSpellingOnOff()
If Application.Options.CheckGrammarAsYouType = True Or Application.Options.CheckSpellingAsYouType = True Then
Application.Options.CheckGrammarAsYouType = False
Application.Options.CheckSpellingAsYouType = False
Call MsgBox("Grammar & Spell Checking turned OFF")
Else
Application.Options.CheckGrammarAsYouType = True
Application.Options.CheckSpellingAsYouType = True
Call MsgBox("Grammar & Spell Checking turned ON")
End If
Application.ScreenRefresh 'refresh to add/remove spellchecker underlines
End Sub
Solution 2:
So I have it set up a little differently. I mainly use it when I am writing out presentations that have code in it. I've assigned the macros to keys and here are both macros:
This will ignore all proofing, so gets rid of those annoying markers from Word
Sub CodeFont()
'
' CodeFont Macro
' Change font to differentiate code
'
Selection.Font.Name = "Consolas"
Selection.Font.Size = 11
Selection.Font.ColorIndex = wdBlue
Selection.NoProofing = True
End Sub
And when I want to revert back to "normal" typing
Sub Normal()
'
' Normal Macro
'
'
Selection.Font.Name = "Times New Roman"
Selection.Font.Size = 12
Selection.Font.ColorIndex = wdBlack
Selection.NoProofing = False
End Sub