Disable spell check for code in Microsoft Word

I don’t like to rely on the Word spell check tool but I alway run it as a last check to make sure I didn’t miss anything. One of the biggest annoyances I’ve had (beside using Microsoft Word) is when code comes up as spelling errors. After spending 15 min clicking “ignore” I finally figured out how to get around this.

Assuming you have all your code styled with a particular style (say “code”):

  1. Choose: Format > Style… > [Your Style] > Modify
  2. In the Modify dialog, select “Language…” from the format drop down menu in the lower left corner.
  3. In the Language dialog check the box for “Do not check spelling or grammar.”

Now the code will not be included in spell checking.