Applying a Character Style to Bracketed Text

Written by Allen Wyatt (last updated November 9, 2019)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365


1

Kat has a document that has various words and phrases surrounded by double angle brackets, as in << this is my phrase >>. She needs to apply a character style to the text surrounded by angle brackets in this manner, but she's at a loss as to how to do so.

When it comes to this type of situation, you can easily use the Find and Replace feature of Word. Let's assume, to begin with, that you don't need to delete the angle brackets. In this case, follow these steps:

  1. Press Ctrl+H. Word displays the Replace tab of the Find and Replace dialog box.
  2. Click the More button, if it is visible. (See Figure 1.)
  3. Figure 1. The Replace tab of the Find and Replace dialog box.

  4. Select the Use Wildcards check box.
  5. In the Find What box, enter this: \<\<*\>\>
  6. In the Replace With box, enter this: ^&
  7. With the insertion point still in the Replace With box, click the Format drop-down list and choose Style. Word displays the Replace Style dialog box. (See Figure 2.)
  8. Figure 2. The Replace Style dialog box.

  9. Use the controls in the dialog box to locate and select the character style you want applied.
  10. Click OK to dismiss the Replace Style dialog box. The style name should appear just below the Replace With box. (See Figure 3.)
  11. Figure 3. Ready to replace.

  12. Click Replace All.

The key here is that you are doing a wildcard search. This allows you to specify a pattern that should be searched for. This pattern is entered in step 4—you want the two angle brackets, followed by any number of characters, and then followed by two opposite angle brackets. The backslashes in the pattern indicate that the character immediately following (an angle bracket character) is to be matched literally. This is required because the angle brackets would otherwise be interpreted by Word as special wildcard characters.

What you are replacing with (in step 5) is a code that indicates you want to replace whatever is found with the same characters that were found. Since the text that is found is replaced with the exact same text, the only real change is that the character style you specified in step 7 is applied to that text.

What can you do, though, if you want to delete the angle brackets as you apply the character style? This, too, can be done using the Find and Replace. In fact, the steps are the same as already outlined; the only change is that you need to modify what you are searching for (step 4) and replacing (step 5). Here's what you should search for:

(\<\<)(*)(\>\>)

Note that the only difference in this Find What pattern is the addition of the parentheses. In a wildcards search pattern, this simply "groups" what is found. In this case you are specifying three groupings—the opening angle brackets, the text between the angle brackets, and the closing angle brackets. You would then specify the following in the Replace With box:

\2

This indicates that you want whatever is found to be replaced with the contents of the second grouping, which means the text originally between the angle brackets.

Provided you followed all the steps previously outlined (with the two changes to steps 4 and 5), not only should the character style be applied, but the angle brackets should be removed.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13697) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Understanding the POWER Function

The POWER function is used to raise one value to another value. However, Excel also provides an exponentiation operator ...

Discover More

Adding an Ellipsis to the Beginning of Some Paragraphs

The Find and Replace feature of Word is very powerful. You can even use it to add a unique character to the beginning of ...

Discover More

Aligning Paragraphs in a Macro

Using a macro to format your document (or portions of your document) is not all that uncommon. If you want your macro to ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (ribbon)

Initiating a New Search

I do a lot of searching in my documents. Sometimes the searches may not go exactly as I expected. Here are some things I ...

Discover More

Replacing with Plain Text

When using Find and Replace, how your replacements are formatted will depend on how the text being replaced is formatted. ...

Discover More

Selectively Find and Replace Page Borders

Using Find and Replace you can both find and replace graphics in your document. Replacing graphics selectively is a bit ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 2 + 2?

2019-11-09 14:26:49

Kat Lind

Thank you so much! This will save me hundreds of hours in a year!

With much appreciation - Kat


This Site

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.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.