Do not spellcheck!

Generally speaking, you should spellcheck everything you write. Word has some fairly decent in-built spelling and grammar checking, and while it may not get everything, it’ll catch a lot. However, on occasion, there’s content you really don’t want to spellcheck. Case in point: API/developer documentation rife with code samples: yes, I did mean to spell it that way; yes, it is all one word; no, I don’t want to capitalise that just because it’s at the start of a line; no, I don’t want a space after that semi-colon… And by the time you’ve hit Ignore for the umpteenth time in a row, you realise you’re back in body text, and you’re not sure how long you’ve been on auto-pilot clicking Ignore, and who knows what garbage you’ve said is ok to leave as is now, and you may as well go right back to page 1 and start over. So what do you do? Forego spellchecking entirely? Copy and paste the non-code-sample bits to a separate doc, spellcheck, then merge back in? Or magically tag the code samples as not to be spellchecked and live happily ever after? It’s a leading question, I admit it. The last option it is, and today’s post is on how to do just that!

The procedure below describes how to mark a style as not to be spellchecked starting from an open doc in Word 2013. The process should be similar in other versions.

  1. If you don’t already have a style for the content you don’t want to spellcheck, create a new style as follows:
    1. Click the More icon (The More icon) on the Styles section of the Home ribbon.
    2. Click Create a Style.
    3. In the dialog that appears, enter a style name then click OK.
  2. Right-click the style you want to mark as not for spellchecking in the Styles section of the Home ribbon and click Modify…. The Modify Style dialog appears.
    The Modify Style dialog in Word
  3. In the Modify Style dialog:
    • Make any required changes to the look and feel of the style: what font, size, justification, colour, and line-spacing do you want?
    • Select whether you want the style to be available Only in this document or also in New documents based on this template.
    • The Language dialog in WordClick Format | Language, and in the Language dialog, select the Do not check spelling or grammar option, then click OK.
  4. Click OK in the Modify Style dialog to save changes to the style.
  5. Because Word sometimes has a “memory” of the document it’s working with, you should save and close your document now, and reopen before trying out your new paragraph and its magic non-spellcheck-iness.
    When you re-open, tag some paragraphs with the new style, deliberately put in a heap of mis-spellings, and bad grammar, then run a spellcheck and watch Word ignore your deliberate errors.

Notes:

  • You can also the Do not check spelling or grammar option on for both paragraph and character styles. Using it for character styles can be useful if you want to tag content in the middle of another paragraph, for example in tutorial content where you refer to methods, classes, or instances in corresponding code samples.
  • In the case of code samples in particular, if you’re feeling really keen, you could create a companion style for comments and mark that as to be spellchecked, on the assumption that your comments will use regular language, spelling, and capitalisation rules. Be careful that you apply the correct style to the corresponding parts of each code sample, though.

Author: smurphy

Writer, mother, gardener, geek...