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

Generating a List of Macros

Got a workbook that has lots and lots of macros associated with it? Here's a way you can get a list of all of those ...

Discover More

Making Sure Styles Do Not Update Automatically

One of the features of Word that can cause some problems is one that allows styles to be automatically updated based upon ...

Discover More

Switching Headers in a Frozen Row

Excel allows you to "freeze" rows in your worksheet. What if you want the rows that are frozen to change as you scroll ...

Discover More

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!

More WordTips (ribbon)

Replacing and Renumbering

Word has a powerful find and replace capability that can help you perform quite a few changes to your documents. This tip ...

Discover More

Replacing an X with a Check Mark

In order to provide a finishing touch to your document, you may want to replace mundane X marks with fancier check marks. ...

Discover More

Keyboard Control of the Find and Replace Dialog Box

Hate to take your hands off the keyboard? This tip explains how you can use the keyboard to work with the Find and ...

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 five less than 6?

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.