How can I disable spelling check for words contain multiple uppercase letters?

e.g. "LaTex", "MathJax", etc.

Besides adding such words into custom dictionaries one by one.


Solution 1:

There is no Word setting that can do this.

You can, though, use a No Spell Check character style and apply it to the words.

This is a setting that sticks with the word in the document regardless of which computer is used to open the document, unlike adding words to your spell check dictionary. Adding to your dictionary stops flagging on your computer only.

Here is a macro to create such a character style:

Sub NoSpellCheckStyle()  ' SEE ALSO ASSIGNSHORTCUTNOSPELLCHECK FOLLOWING
    ' Charles Kenyon
    ' Creates a character style named "No Spell Check" in the Active Document
    ' Does NOT apply the style to a selection, simply creates the style
    ' 12 April 2019
    '
    Dim stlNoCheck As Style
    '
    On Error GoTo ErrorAlreadyExists
    Set stlNoCheck = ActiveDocument.Styles.Add(Name:="No Spell Check", Type:=wdStyleTypeCharacter)
    On Error GoTo -1
    With stlNoCheck
        .Font.Name = ""
        .NoProofing = True
    End With
    GoTo ExitSub
ErrorAlreadyExists:
    MsgBox Prompt:="Style 'No Spell Check' already exists", Buttons:=vbInformation, title:="Oops"
ExitSub:
    Set stlNoCheck = Nothing
End Sub

Here is a separate macro to assign a keyboard shortcut to the character style:

Sub AssignShortcutNoSpellCheck()
'
' Charles Kenyon ---- GOES WITH PREVIOUS MACRO
' 2 March 2021
' Assigns keyboard shortcut Ctrl+Shift+Alt+N to No Spell Check style
'   Style must exist
'   Saves this in the active document
'
    CustomizationContext = ActiveDocument ' Change ActiveDocument to NormalTemplate if style is in Normal Template
    KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyN, wdKeyControl, _
        wdKeyShift, wdKeyAlt), _
        KeyCategory:=wdKeyCategoryStyle, _
        Command:="No Spell Check"
End Sub

You can change the keyboard shortcut to something else if you want.

Note that you can use Ctrl+Spacebar to return to the underlying paragraph style after using the character style.

With words that are already in your document, you would select the word and apply the character style.

When typing, you would turn on the character style and then type your Word, following with Ctrl+Spacebar.

Remember that the "do not check" attribute is an invisible formatting code and it acts much like Bold in that it continues in operation when you type, except that you cannot see it.