bottom
Great WordTips!
         
Your e-mail address is safe!
Close Note

Tips.Net > WordTips Home > Editing > Find and Replace > Selective Formatting in Searches

Selective Formatting in Searches

Summary: Need to search for text that has different formatting within the search term? Word can’t handle something this complex, but you can create a macro to do the searching for you. (This tip works with Microsoft Word 97, Word 2000, Word 2002, and Word 2003.)

Word includes a powerful find and replace feature that can be used to find all sorts of information and then replace it with equal aplomb. One thing you cannot do, however, is to search for information that has "mixed formatting" within it. For instance, you cannot search for the character X in regular typeface followed by the character Y in a monospace typeface.

There are, of course, ways around this, provided you are willing to use macros to do your work. For instance, your macro could do the following:

  1. Search for the next instance of XY.
  2. When found, examine the instance to determine if the desired formatting is present.
  3. If not, start over at step 1.

This approach, while easy to create, has only a limited utility. Since step 2 would need to be "hard coded" into the macro, going through the trouble of changing the macro to accommodate the formatting needs would only be of value if you have quite a few instances of XY that you are looking for.

Tip #1552 applies to Microsoft Word versions: 97 | 2000 | 2002 | 2003


More Power! Expand your skills and make Word really sing! It's all possible with macros. The best resource anywhere for macros is WordTips: The Macros. Check it out today!

Helpful Links

Ask a Word Question
Make a Comment

Tips.Net Home
Vital News Home

WordTips FAQ
WordTips Premium

Learn Access Now

Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Pet Tips
Word2007 Tips
WordTips

Advertise on the
WordTips Site

 

Great Info!

Get tips like this every week in WordTips, a free productivity newsletter. Enter your e-mail address and click "Subscribe."
     
(Your e-mail address will never be shared with anyone, ever.)