Create a Microsoft Word Quick Style for a Code Snippet Box

I've figured out how to do this:

  1. Highlight arbitrary text in the document
  2. In the Styles chunk of the ribbon, Save Selection as new Quick Style...
  3. In the Modify Style dialog, click Format at the bottom.
  4. Select Frame
  5. Set Text Wrapping to Around
  6. Click OK, then in the Format menu select Border
  7. In the Shading tab, pick a Fill with the background color, e.g. gray

For Office 2007 and 2010, you'll want to use the Shading tool:

enter image description here

That should do what you want.

I don't have an older version of Office handy to check, but you'll probably find the same tool under Format -> Paragraph, or similar menu option.


From Office 2013 there is a new quick style called 'Code'. You can disable spell-check by

Format->Language->Disable automatic spell-checking.