Word.Tips.Net WordTips (Menu Interface)

Formatting Partial Results of a Search

Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Formatting Partial Results of a Search.

Agnes has a series of paragraphs that begin with a title that is followed by a period and two spaces. She would like to search for this pattern (multiple words at the beginning of a paragraph followed by a period and two spaces) and underline just the words, exclusive of the period and the spaces.

This can be done with a wildcard search, in the following manner:

  1. If the first paragraph in your document includes information you want to have underlined, position the insertion point at the beginning of the document and press Enter a single time.
  2. Jump to the end of your document. (This is important; the reason will be explained shortly.)
  3. Press Ctrl+H. Word displays the Replace tab of the Find and Replace dialog box.
  4. Click the More button if it is available. (See Figure 1.)
  5. Figure 1. The Replace tab of the Find and Replace dialog box.

  6. Enter the following in the Find What box: ^13[A-z 0-9]{1,}[!. ]
  7. Enter the following in the Replace With box: ^&
  8. With the insertion point in the Replace With box, press Ctrl+U.
  9. Make sure the Use Wildcards check box is selected.
  10. Using the Search drop-down list, chose Up. (You are at the end of the document and you want to search upwards through the document.)
  11. Click on Replace All.
  12. Close the Find and Replace dialog box.
  13. If you pressed Enter in step 1, you can get rid of that blank paragraph.

That's it. The search pattern you entered in step 4 indicates that you want to search for paragraph marks (^13) followed by any length combination of letters and digits ([A-z 0-9]{1,}), terminated by a period and two spaces ([!. ]). The exclamation mark on means that while the period and two spaces are to be used to determine a match, they aren't to be included in the actual text that is found.

All of this is then used in the Replace With, as the ^& combination means to use the "found" text as the replacement. This, however, is formatted with an underline.

Understand that steps 2 and 9 are very important. If you don't do the search from the bottom of the document toward the top, you won't get the desired results.

As presented above, the steps result in all the text before the period being underlined. If you prefer to have a different type of underline (such as underlining only the words), then in step 7 you should click the Format button, choose Font, and use the Underline drop-down list to specify the type of underline you desire.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (9075) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Formatting Partial Results of a Search.

Related Tips:

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!


Leave your own comment:

  Notify me about new comments ONLY FOR THIS TIP
Notify me about new comments ANYWHERE ON THIS SITE
Hide my email address
*What is 5+3 (To prevent automated submissions and spam.)
           Commenting Terms

Comments for this tip:

Phil Rabichow    12 Dec 2015, 13:55
Problem solved, but with a different solution. It's a 3 step process.
Using wildcards:
1. Find: (^13[A-z 0-9]{1,})([.][ ]{2})
Note that this uses 2 expressions. The first finds a paragraph mark followed by any combination of letters, spaces, & numbers. The 2nd finds a single period followed by 2 spaces.
    Replace all: \1%%%% & press Ctrl+U to make it underlined. The \1 replaces only the first expression, so the %%%% (any series of characters that aren't in your document) replaces the period & two spaces, all underlined.
2. Find: %%%%
    Replace all: press Ctrl+U to change the formatting to "no underline" & type a period & 2 spaces. (then do replace all)

This technique is the only one I found that changes part of a "find".

Our Company

Sharon Parq Associates, Inc.

About Tips.Net

Contact Us


Advertise with Us

Our Privacy Policy

Our Sites


Beauty and Style




DriveTips (Google Drive)

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2016)



Home Improvement

Money and Finances


Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2016)

Our Products

Helpful E-books

Newsletter Archives


Excel Products

Word Products

Our Authors

Author Index

Write for Tips.Net

Copyright © 2016 Sharon Parq Associates, Inc.