Search code examples
vbams-wordspell-checking

How do I programmatically turn off the wavy red lines in a Microsoft Word document via VBA?


Is there anyway to disable spell checking on a per document basis via VBA for MS Word?


Solution

  • You can mark the current document as already spell-checked:

    ActiveDocument.SpellingChecked = True
    

    or you can disable spell checking for a range of text:

    ActiveDocument.Range.NoProofing = True
    

    You can also simply disable the display of the red squiggles:

    ActiveDocument.ShowSpellingErrors = False
    

    Note that the same things can be done for grammar-checking (green squiggles); e.g.:

    ActiveDocument.GrammarChecked = True
    

    will mark the current document as already grammar-checked, thus effectively disabling it.