In today’s post, we will focus on showing 3 ways to batch change the color of texts in brackets in your Word document.
It’s not uncommon to use various types of brackets in your document. For texts enclosed in brackets, they are of equal importance with those not. Even sometimes, you find you have to stand them out. Given to this demand, we’ve sorted out 3 quick approaches available for you to batch change the color of texts in brackets.
Method 1: Use “Advanced Find” to Find All Texts in Brackets
- To begin with, click “Home” tab in the Ribbon.
- Next in “Editing” group, click the drop-down button next to “Find” command.
- On the drop-down menu, choose “Advanced Find” to open the “Find and Replace” dialog box.
- Then place cursor inside “Find what” text box and enter one of the strings in the following table.
Brackets | Strings to Find Brackets and All Enclosed Texts |
Square Brackets
[ ] |
\[*\] |
Parentheses
( ) |
\(*\) |
Braces (Curly Brackets)
{ } |
\{*\} |
Angle Brackets
< > |
\<*\> |
- Click “More” tab.
- Then check “Use wildcards” box.
- Click “Find In” and select “Main Document”.
- Now you shall see all texts inside the specific type of brackets are in selection.
- You can go on performing in the “Find and Replace” box by clicking “Format” tab and choose “Font”.
- In “Find Font” box, choose a font color and click “OK”. Then the font color in brackets shall be changed.
- Or you can press “Ctrl+ D” to open the “Font” box and set a font color there.
Method 2: Use “Find and Replace” Feature to Change Font Color
- Firstly, press “Ctrl+ H” to trigger “Find and Replace” box.
- In “Find what” text box, enter a string available on the table in method 1.
- And in “Replace with” text box, enter “^&”.
- Then click “More” and check “Use wildcards” box.
- Next click “Format” button and choose “Font”.
- Set a font color there and click “OK”.
- Finally, click “Replace All” in “Find and Replace” box.
Method 3: Run VBA Codes to Change the Color of Texts
Running the following macro will change all enclosed texts in all types of brackets to a designated color.
- Press “Alt+ F11” to invoke VBA editor.
- Then click “Normal” project.
- Next click “Insert” and choose “Module”.
- Double click to open the newly created module and paste codes there:
Sub ChangeTheFontColorInBrackets() Dim objRange As Range Dim strFontColor As String Set objRange = ActiveDocument.Content strFontColor = InputBox("Enter the font color you want to change", "Font Color", "For example:2") ' Find the words in brackets and change the font color. With objRange.Find .Text = "\[*\]" .MatchWildcards = True .Replacement.Font.ColorIndex = strFontColor .Execute Replace:=wdReplaceAll .Text = "\(*\)" .Replacement.Font.ColorIndex = strFontColor .Execute Replace:=wdReplaceAll .Text = "\{*\}" .Replacement.Font.ColorIndex = strFontColor .Execute Replace:=wdReplaceAll .Text = "\<*\>" .Replacement.Font.ColorIndex = strFontColor .Execute Replace:=wdReplaceAll End With End Sub
- Hit “F5” to execute codes.
- There will be an input box prompting up. You can look up the value of a specific color at this web page:
https://docs.microsoft.com/en-us/office/vba/api/Word.WdColorIndex
Just enter a value and click “OK” to proceed.
Here is the possible outcome:
Address Document Corruption Properly
You shouldn’t rely on luck to keep data safe. Instead, you need to make full preparation before any data disaster happens. One of the most is to obtain a specialized tool to fix damaged word in advance.
Author Introduction:
Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including Excel repair and pdf repair software products. For more information visit www.datanumen.com
1