Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 825
GeneQ Avatar asked Sep 29 '10 13:09

GeneQ


2 Answers

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.

like image 183
Dirk Vollmar Avatar answered Oct 06 '22 23:10

Dirk Vollmar


ActiveDocument.ShowSpellingErrors = False
like image 45
Lunatik Avatar answered Oct 07 '22 00:10

Lunatik