THE SQL Server Blog Spot on the Web

Welcome to - The SQL Server blog spot on the web Sign in | |
in Search

John Paul Cook

Globally changing the color of a font in Word

Sometimes when writing documentation, I need to change all occurrences of a certain font color to another. This post isn’t just about Word, it’s also about protecting SQL Server passwords. I didn’t find a complete explanation of how to globally edit font colors in Office 2007 and Office 2010, so I thought it might be helpful if I walk you through the process. As a bonus, I’ll also show you how to activate Word’s cloaking device (I’ll bet you didn’t know it had one). In the final paragraphs, I make a serious point about using the cloaking feature to safeguard passwords.

Although I’ve definitely needed to do this at work, my example is from a school assignment. One of my instructors wrote a practice test for us complete with all of the answers in red. To best take advantage of this practice test, I need a copy of it without the answers. If I manually delete the answers one by one, I’ll remember some of them, which would make the practice test less effective.

There is a neat trick for logically deleting text. If you want text to disappear, change the font color to the background color. Most of the time our background color is white, so changing a font to white makes the text disappear. By globally changing all red text to white, I can make the answers to my practice test disappear.

Begin by pressing Shift F1 to bring up Reveal Formatting.


Select one of the sections of text you want to change the color of. It will appear in the Selected text box.


Go to the Selected text box and select the menu option Select All Text With Similar Formatting


You will see that all text with exactly the same formatting is now selected.


In the Formatting of selected text section, click Font. Select the font color. Since I want to make all red text disappear, I chose white as my new font color.


Everything that was red is now white.


Now all of the answers to the practice test questions are cloaked. Although you can’t see the answers, they are still there, but they won’t appear when printed or viewed.


Remember, you can choose any color, not just white or the background color. You can change from any color to any other color.

First, let me clarify that I'm not advocating storing passwords in clear text in a file. But many people do, which creates a security vulnerability because a bystander might see the passwords displayed in the document. For those who do stored passwords in a file, if every password in the document has a white font, a bystander will have nothing to see. I personally use this technique at home to keep track of the passwords I use at the many websites I visit. As a note of explanation, I do not use the pipe character (vertical bar) in any of my passwords. Because of this, I’m able to delimit my white colored passwords with pipe characters as this example shows:

SuperSecretUser |ThanksForReadingMyBlog|

By using the cloaking technique, I can have the list of passwords up on the screen without anybody being able to see them. I position the cursor between the pipe characters, double-click, and then do Ctrl C to copy the password into my paste buffer. It’s very convenient. If you chose to adopt this approach, I recommend using EFS to secure the file.

If you want to try this out for yourself, I recommend copying the entire line shown above and pasting it into Word. The behavior of selecting white text in Word is different from the behavior of selecting white text on a web page.

Remember, security management is a balance between not revealing a password and still being able to get work done in case a password is forgotten. Relying on memory to remember every password for everything is a questionable business practice because people do forget. As reader csm correctly points out below, there are better, more secure ways of keeping track of passwords. But it is a fact that people do store passwords as text strings in files. For those who do, the technique of using the background color font does prevent an onlooker from seeing the passwords. I wouldn't use the file based approach on a production machine storing senstive data, but I think it’s okay for a low security development environment when you're not allowed to use Windows authentication exclusively.

Published Wednesday, January 19, 2011 12:52 PM by John Paul Cook

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS



Jerry Hung said:

Cute idea, thanks for sharing

January 19, 2011 5:03 PM

csm said:

I still think that store the passwords in an office document is a bad idea. I use KeePass Password Safe, a free software just for that: store passwords (and many other cool features) in a strong (encrypted) way.

I think you could take a look:

January 20, 2011 5:49 AM

MikeD said:

I have been going crazy trying to figure out how to change the font color globally in a document that was interspersed with other font colors and was way too lengthy to do by hand.  You totally saved my day, thanks!

August 29, 2011 7:21 PM

Mary A. Rowe said:

I agree with Mike D at this late date.  We don't use the WORD editing function with the review panel, etc. and I've had to manually delete all the red strike-thoughs and then block and change all the blue double-underlined text...the reviewing pane is so helpful!  Thanks for posting this.

March 30, 2012 9:00 PM

Anne said:

Thks John, exactly what i was looking for and a real time saver!!!

May 17, 2012 4:20 AM

Christine said:

Excellent! Just what I needed!

January 25, 2013 9:52 AM

Leave a Comment


About John Paul Cook

John Paul Cook is a database and Azure specialist in Houston. He previously worked as a Data Platform Solution Architect in Microsoft's Houston office. Prior to joining Microsoft, he was a SQL Server MVP. He is experienced in SQL Server and Oracle database application design, development, and implementation. He has spoken at many conferences including Microsoft TechEd and the SQL PASS Summit. He has worked in oil and gas, financial, manufacturing, and healthcare industries. John is also a Registered Nurse currently studying to be a psychiatric nurse practitioner. Contributing author to SQL Server MVP Deep Dives and SQL Server MVP Deep Dives Volume 2. Connect on LinkedIn

This Blog



Privacy Statement