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

How do I prevent a style from changing the font color. I have "Automatic" selected as the font color (and the "Default" button under "Font" is disabled by the way), but whenever I apply the style, the font color changes to black. Using Word 2007

share|improve this question
up vote 3 down vote accepted

A style is intended to modify the appearance of the text it is applied to, including colour. You don't want to stop it from doing that. If you don't like the colour it is applying, you should change the style itself. If you want to keep the old style for other documents, but change the colour for a specific document, just make a copy of the style, modify the copy and apply the modified style instead of the original one.

To make a new style, go to the start tab. In the ribbon, there is a section called Styles. In the lower right corner, there is a UI element, a small right angle with an arrow pointing away from it. Click it, and you'll see a floating window listing all styles. Select the style you want to change from the list. Under the list, there are three buttons. If you want to make a copy based on the old one, select the button for creating a new style. If you want to change the old one, select the button for managing styles. A new window opens with yet another list of styles, where your style is still selected. About the middle there is a modify button, click it.

In both cases, you see a new window where you can modify the (new copy of the) style. Under Format, there is a drop-down box where you can select the font colour you like. Choose the colour you like, save your changes and you're done.

If you have a corporate colour scheme and want to use the standard Word 2007 layouts but with your own colour scheme, there is an easy way to do that. In the Styles section of the ribbon under the Start tab, there is the big button called "Change styles". Clicking it opens a small menu. Select colours, and you are given the choice of the typical Word 2007 colour schemata. At the bottom, there is a option called "Create new design colours". There you can set colours for different purposes. Choosing the scheme will change the colours of the standard styles to the new ones, and you can always go back to standard by choosing the "Larissa" integrated colour scheme again.

Disclaimer: As I had to backtranslate from my non-english Word, maybe I've gotten the names of some UI elements wrong, but I guess it will be easy to find them.

edit re: your comment

Styles are meant to change the formatting of text, I don't think there is a way to stop this behaviour. However, I don't see a reason for applying a style at all. Just paste the code and select the option to preserve the original formatting. I just tried with code from Eclipse, I think it will support formatting from other IDEs too.

Also, whatever you are doing, maybe you're trying to solve your problem in the wrong way. I hope you aren't trying to program in Word. If you're writing some sort of coding tutorial, why do you need the code as text? You could include the examples as screenshots. Or you could write the whole thing in LaTeX (if you know LaTeX or if your layout is basic enough), because there are ways to syntax highlight code snippets in LaTeX, or to generate syntax highlighted LaTeX source from a source code. Or if you're that desperate, make the whole thing in HTML. Use CSS for the layout of the generic text surrounding the code, then feed your code through something like Pygments, and paste the HTML output directly into your document; the HTML tags formatting should overwrite the CSS style.

Of course, maybe I'm wrong and there is a way to apply a style in Word without changing the font colour. But I doubt it, it would go against the very purpose of styles.

share|improve this answer
Ahh but see my problem is that that the text that I wish to apply the style to has multiple colors (it is actually source code with formatted coloring, certain bolded words, etc. So I can't set one color for the style, I need it to simply accept whatever color and bold, etc. it encounters and not change it, and only make changes to what I explicitly instruct it to (in this case special numbering, background color, and indentations) – WaelJ Mar 26 '10 at 19:21
Yes I do preserve the original formatting when pasting (with the color and bold, etc.) It turned out not to be such a big problem. Applying the style would only modify the first color it encounters, so if I have say a couple green words, and then a blue words, etc... , then applying the style to that block of text would change the initial green words to black, and the rest would remain as it is. So I simply applied the style to each section and then manually changed the color of that first bit. Weird implementation of styles if you ask me :S Thank you for your extended response ;D – WaelJ Mar 27 '10 at 12:27
This would be acceptable, if there was a way to prevent spell checking on a section of code. Currently, AFAIK, the only non-manual way of doing this is to embed it into a style. – Wonko the Sane Nov 1 '11 at 15:17

Not sure if this is even remotely reliable, but I have discovered that if I copy/paste syntax highlighted code from Visual Studio 2010 into Word 2010, then select the line just above the code block with it before applying a style to it, then the colours are preserved.

I'm inclined to agree with what rumtscho's answer says with regard to how styles should behave, so I wouldn't depend on this - seems like a bug (but it may be useful to someone). Different versions of Word etc. may well behave differently...

share|improve this answer
This worked for me - thanks. I realized that Word tries to work out what's 'normal' by looking at the first word or first line - anything that matches this will be replaced with the new styling. So if I add a new line and set the color of it to something NOT used in the code block, Word doesn't try to change the color of the rest of the block. – Ian Grainger Oct 24 '12 at 11:51

You must log in to answer this question.

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