Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, and Word in Office 365. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Searching for Non-Black Text.
by Allen Wyatt
(last updated June 16, 2018)
When searching for text in a document, it is easy to search for formats such as "bold" or "italic." You can also search for "not bold" and "not italic." You can search for text of a specific color, but Word does not allow you to search for text other than a specific color. For instance, you cannot search for text that is "not black."
If you need to search for text that is not black, then the best way to do so is with a macro. Consider the following macro, which prompts you for your search text, and then looks for the first non-black instance of that text.
Sub FindNotBlack() With Selection.Find .ClearFormatting .Text = InputBox(prompt:="Enter the search text.", _ Title:="Find Nonblack Text") Do While .Execute With Selection.Font If (.Color <> wdColorAutomatic) And _ (.Color <> wdColorBlack) Then MsgBox "Found" Exit Sub End If End With Loop End With End Sub
Note that the macro checks to see if the color of the matched text is different from black (wdColorBlack) and from the automatic color (wdColorAutomatic). This is because the automatic color is black on most systems.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (11644) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Office 365. You can find a version of this tip for the older menu interface of Word here: Searching for Non-Black Text.
Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!
Need to look for a piece of text possessing a particular formatting attribute? Here's the skinny on how this is accomplished.Discover More
Want to find all the paragraphs in your document that have borders applied to them? The regular Find and Replace tool ...Discover More
Word makes it easy to find text that uses a particular font or font characteristics. What it doesn't do is make it easy ...Discover More
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.