by Jack Lyon
Replacing Basic Text
Searching with wildcards in Microsoft Word can accomplish miracles in editing, but some people find wildcards a little too arcane to deal with. If you’re one of those people, you might benefit from some of Word’s lesser-known but easier-to-use search options. But first, let’s do a basic find and replace. Open Word’s “Find and Replace” dialog by pressing CTRL + H (or click Home > Editing > Replace on Word’s ribbon interface). Then:
- In the “Find what” box, enter a word you want to search for. (We’ll use the misspelled “millenium” as an example.)
- In the “Replace with” box, enter a word you want to replace the incorrectly spelled “millenium” with. (We’ll use the correctly spelled “millennium” as an example.)
- Click the “Replace All” button.
That’s it. Every occurrence of “millenium” will be replaced with “millennium.” Simple and quick.
Refining Your Search
But wait—there’s more! Microsoft Word provides many ways to refine your search. See the “More” button at the bottom of the “Replace” dialog?
Click it. Here’s what you’ll see:
Under “Search Options,” you can specify whether to search up, down, or through all your text:
You can also match case and find whole words only:
There are actually lots of options, all worth exploring:
Match case
Obviously, this option finds only text that matches the case (capitalized or lowercased) of the text in the “Find what” box. If you enter “Hello” in the “Find what” box with “Match case” checked, Word finds “Hello” but not “hello.” If you enter “hello,” Word finds “hello” but not “Hello.”
Find whole words only
This option finds whole words only. For example, if you search for “sing,” Word finds “sing” but not “singing.” If this option is not checked, Word finds both “sing” and “singing,” as well as “using” and “kissing.”
Use wildcards
This option tells Word that you want to search using wildcards:
Wildcards are important, but in this article we’re trying to avoid these. For explanations and examples, see my past articles (e.g., Lyonizing Word: From Easy to Impossible — Three Variations on a Theme, Lyonizing Word: The Easy Way, Not So Easy, Lyonizing Word: The Easy Way, Not So Easy, and Lyonizing Word: We Can Do This the Easy Way, or . . . ; if you use EditTools, see The Business of Editing: Wildcarding for Dollars). Please note, however, that if this option is checked, you can no longer select “Match case” or “Find whole words only.” Even so, during a wildcard search, “Match case” is automatically enabled, even though it’s not shown as enabled (an oversight on Microsoft’s part). “Find whole words only,” on the other hand, is inactive.
Sounds like (English)
This option finds words that sound like the word in the “Find what” box. For example, if you search for “cot,” Word also finds “caught.” If you search for “horse,” Word also finds “hoarse.” This could be useful if you’re working on a document in which certain words have been confused or mistyped. Basically, this feature works on words that are homophones; it doesn’t seem to work on words that sound almost alike, such as “horse” and “whores.” On the other hand, while searching for “horse,” it also finds “horsey” but not “horses,” so who knows?
Find all word forms (English)
This option finds what Microsoft calls “all” forms of the word in the “Find what” box. For example, if you search for “sit,” Word also finds “sat” and “sitting.” The word “all” is a little misleading, however. The feature relies on an underlying database of word forms that is pretty good but has some omissions. For example, if you search for “eat,” Word finds “eat, “ate,” “eaten,” and “eating” but not “eater.” Similarly, if you search for “horse,” Word finds “horse,” “horses,” and “horsing” but not “horseless.” It’s a useful feature, mostly for finding verb forms; just don’t expect it to actually find all forms of a word.
Match prefix
This option matches words beginning with the search string. For example, if you put “pre” in the “Find what” box, Word finds “prepare,” “present,” and so on. This isn’t a “smart” feature; it searches for characters only, not word roots. For example, searching for “pre” also finds “prestidigitation” and “pressure,” even though “pre” isn’t really a prefix in those words.
Match suffix
This option matches words ending with the search string. For example, if you put “ing” in the “Find what” box, Word finds “singing,” “typing,” and so on. This isn’t a “smart” feature; it searches for characters only, not word roots. For example, searching for “ing” also finds “boing,” “spring,” and “thing,” even though “ing” isn’t really a suffix in those words.
Ignore punctuation characters
Ignores punctuation characters between words. For example, “trees plants and flowers” finds “trees, plants, and flowers” as well as “trees plants and flowers.” This might be useful for fixing problems with serial commas.
Ignore white-space characters
Ignores all white space (spaces, tabs, and so on) between words. For example, “webpage” finds “web page” as well as “webpage.” This is the inverse of “Find whole words only” and could be useful for fixing words that are sometimes spelled open and sometimes closed.
Other options
If you’re working in a language other than English, other options may be available, including Match Kashida, Match Diacritics, Match Alef Hamza, and Match Control. I know almost nothing about these options, so I can’t comment on them with any degree of expertise.
Format
One of the most important tools in Microsoft Word’s find and replace toolbox is the ability to search for formatting — all kinds of formatting. To do so, click the “Format” button:
Here’s what you’ll get:
Each option (such as “Font”) opens the usual dialog for that feature:
I won’t go into all of the options in these dialogs as they’re basically the same ones you’d get while formatting any text in Word. “Font” displays font options, “Styles” displays styles, and so on. You can select any of those options and use them as something to find or replace. For example, if your cursor is in the “Find what” box and you select “Italic” in the “Find Font” dialog, here’s what you’ll get:
Now Word will find text in italics but not in roman. If you also enter a word, you’ll find that word in italic but not in roman. If you don’t enter a word, you’ll find anything formatted as italic.
But what about the “Replace with” box? What happens if you use formatting there?
If the “Replace with” box includes some text, whatever is found will be replaced by that text in the format you specified. If the “Replace with” box doesn’t include text, whatever is found will be replaced with itself in the format you specified. For example, if you search for the word “apples” to be replaced by “pears” in bold, that’s exactly what you’ll get — “pears” in bold. If you search for the word “apples” to be replaced by bold alone (with no text), you’ll get “apples” in bold.
If, on the other hand, you search for “apples” but don’t specify text or formatting in the “Replace with” box, “apples” will be replaced with nothing; in other words, it will be deleted.
Many variations are possible. Here’s a basic summary:
Find | Replace | Result |
apples | pears | pears |
apples | pears [bold] | pears [bold] |
apples | [bold] | apples [bold] |
apples | [nothing] | [apples deleted] |
[bold] | [nothing] | [bold text deleted] |
[bold] | pears | [bold text becomes “pears” in bold] |
[bold] | pears [italic] | [bold text becomes “pears” in bold italic] |
[bold] | [italic] | [bold text becomes bold italic] |
Note that you can also specify not a certain kind of formatting, such as “not bold” or “not italic” in either find or replace. You can also use combinations of formatting (and “not” formatting). For example, you can search for bold but replace with italic and not bold, which will turn any bold text into italic (but not bold italic) text.
Built-In Codes
In addition to all of those options, Microsoft Word includes lots of built-in find-and-replace codes that are not wildcards (although lots of people call them that). You can use these built-in codes to search for things like paragraph breaks, tabs, section breaks, column breaks, dashes, footnotes, endnotes, graphics, and many other things that aren’t actual text, and codes are a whole lot easier to use than wildcards. In fact, codes should be your default tool; you should use wildcards only when built-in codes won’t do what you need (which is actually fairly often, unfortunately).
Some of Word’s built-in codes can be used only in the “Find what” box; others can be used only in the “Replace with” box. Some of the codes can be used in both boxes.
“Find What” Codes
To see the codes that can be used in the “Find what” box, put your cursor in the box. Now click the “Special” button at the bottom of the “Find and Replace” dialog.
You’ll get a list like this:
Identify the item you want to find and click it, for example, “Paragraph Mark.” You’ll get the following code in the “Find what” box (since that’s where your cursor was located):
^p
That tells Word to find a paragraph break — that is, the end of a paragraph.
Each item on the list will insert a different code. For example, here’s the code for an em dash:
^+
And here’s the code for an en dash:
^=
“Replace With” Codes
Now put your cursor in the “Replace with” box and click the “Special” button again. This time, you’ll get a different list:
Again, clicking one of the list items will insert a code into the “Replace with” box. For example, if you click “Clipboard Contents” you’ll get this:
^c
That’s an extremely useful code, because ordinarily the “Replace with” box can hold no more than 255 characters. But using the ^c code, you can replace with anything that is currently copied to the Clipboard, which can hold many pages of text, graphics, or anything else.
After you’ve worked with built-in codes for a while, you’ll find it easy to just type them in by hand. In the meantime, you can use the “Special” lists to insert them.
You can also use combinations of codes. For example, you could search for tabs followed by paragraph breaks (^t^p) and replace them with paragraph breaks alone (^p).
Here’s a summary of Word’s built-in codes and where they can be used:
Character or object | Find what | Replace with |
Annotation Mark (comment) | ^a | |
Any character | ^? | |
Any digit | ^# | |
Any letter | ^$ | |
Caret character | ^^ | ^^ |
Clipboard contents | ^c | |
Column break | ^n | ^n |
“Find what text” (whatever was found during your search) | ^& | |
Em dash | ^+ | ^+ |
En dash | ^= | ^= |
Endnote mark | ^e | |
Field | ^d | |
Footnote mark | ^f | |
Graphic | ^g | |
Line break | ^l | ^l |
Manual page break | ^m | ^m |
Nonbreaking hyphen | ^~ | ^~ |
Nonbreaking space | ^s | ^s |
Optional hyphen | ^- | ^- |
Paragraph mark | ^p | ^p |
Section break | ^b | |
Tab character | ^t | ^t |
White space | ^w |
Even without wildcards, Microsoft Word’s find and replace features can do an awful lot — much more than you might think. You probably already knew how to use “Match case” and “Find whole words only,” but did you know about those other options? “Ignore punctuation characters” and “Ignore white-space characters,” for example, can be very useful in editing. Being able to find and replace formatting is essential, especially when using styles. And using Word’s built-in codes lets you search for all kinds of things (graphics, page breaks, dashes, and so on) that would otherwise require more advanced techniques (like wildcards and numeric codes). In other words, Microsoft Word’s basic find and replace features aren’t so basic — at least not in what they can do!
Wildcard Cookbook
This article is a slightly modified excerpt from my new book, Wildcard Cookbook for Microsoft Word, now available at Barnes & Noble, Amazon, and other fine bookstores:
Jack Lyon (editor@editorium.com) owns and operates the Editorium, which provides macros and information to help editors and publishers do mundane tasks quickly and efficiently. He is the author of Microsoft Word for Publishing Professionals and of Macro Cookbook for Microsoft Word. Both books will help you learn more about macros and how to use them.
So useful – many thanks!