Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to format some text in my Word doc to have a background color of gray. This is for me to have a Quick Style to apply this formatting. I want to use a monospaced font, like Consolas, and have the entire block have a gray background. When I highlight text and set the background color though, it only set the color behind the text, not the area rectangular area the text sits on within the doc layout. How can I do this?

share|improve this question
Just a quick correction - Consolas is a sans type font, not serif. – Indrek May 2 '12 at 21:01
You're right! I meant monospaced, which is the key to good code snippets. Thanks, I've updated it. – Mark May 3 '12 at 14:04
Technically, monospace and sans/serif are two different properties of a font. For instance, Consolas is monospace sans, while Courier New is monospace serif. But yes, monospace is the way to go for code snippets. – Indrek May 3 '12 at 14:35
up vote 16 down vote accepted

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
share|improve this answer

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.

share|improve this answer
I tried that but it didn't make it into a box around the text itself. Sorry if my question wasn't clear though. I've written my solution I found. Thanks again – Mark May 3 '12 at 14:03

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

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

share|improve this answer

Select the block where you want to fill the background with color, on the home section of microsoft word, above paragraph, the section where you will find the bullets & numbering there is a bucket like paint icon called the shading click the down arrow next to that icon and select any color you want to use for the background then voila!

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .