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

Synchronizing Lists

Two lists of similar data can be challenging to synchronize. Here are some ways that you can align data in two different ...

Discover More

Incomplete and Corrupt Sorting

Using the sorting tools, on the toolbar, may result in some unwanted results, such as jumbled data. If this happens to ...

Discover More

Reversing a String

Need to reverse all the characters in a string? You can do so by using the function described in this tip.

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)

Finding Missing Spaces before Numbers

If you want to insert a space between letters and digits in your document, you have a couple of tasks to perform. First, ...

Discover More

Searching for Optional Hyphens

If you have a document that contains optional hyphens (special characters that mark where a word can be split between ...

Discover More

Making Quoted Text Bold and Underlined

If your document contains quoted text, you might want a way to remove the quotes and format the text in some way. This ...

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 two more than 7?

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.