Finding Elusive Text

Home Tutorials My MVP FAQs Useful Links

 

Does it sometimes seem that Word is playing Hide-and-Seek with you? A problem is caused by something in your document, but you can’t find it. Or you know that a certain text string is in your document, but you can’t find it.

Enter the humble Find dialog, which is one of the most powerful features in Word. No doubt you’ve seen this dialog (or its big brother, Replace) and perhaps used it, but you may be unaware of some of its more arcane uses, which are the topic of this article.

I don’t intend to address the use of wildcards, which are more than adequately dealt with elsewhere, nor will I describe the simpler uses of the dialog. Rather, I will present several common and a few relatively rare scenarios that can be handled using this dialog. These include the following:

The Find dialog

Let’s start by taking a look at the dialog as it appears in Word 2003 and Word 2007. Although you can launch the dialog using Edit | Find in Word 2003 and earlier or with Home | Editing | Find in Word 2007, the easiest way to open the dialog in any of these versions is with the keyboard shortcut Ctrl+F. The results are shown in Figures 1 and 2 below.

The Find dialog in Word 2003

Figure 1. The Find dialog in Word 2003

The Find dialog in Word 2007

Figure 2. The Find dialog in Word 2007

Important Note: In Word 2010 and 2013, both Home | Editing | Find and Ctrl+F open the Navigation pane with the search window on top. To open the Find dialog shown above, you must click the magnifying glass button (the ScreenTip is "Find Options and additional search commands") and then choose Advanced Find from the menu. Sometimes you may find it easier just to press Ctrl+H to open the Replace dialog and then select the Find tab.

If you want Ctrl+F to open the Find dialog instead of the Navigation pane, you can use the Customize Keyboard dialog to change the assignment of the shortcut key from NavPaneSearch to EditFind, but you may want to assign another keyboard shortcut to NavPaneSearch (or NavPane) to make it easy to open the Navigation pane.

The simplest use of the dialog is pretty straightforward. You type some text into the “Find what” box and click Find Next. Word selects the next occurrence of this text that it finds in the document. As long as the Find dialog remains open, the Find Next button remains enabled, and you can press Enter to continue finding subsequent instances of the sought text. The search direction is always Down.

Suppose you want to go back to a previously found instance, however. There are two ways to accomplish this:

  1. The first way is to expand the dialog by clicking More and choose Up in the Search dropdown under Search Options (see Figures 3 and 4).

The expanded Find dialog in Word 2003 showing direction dropdown

Figure 3. The expanded Find dialog in Word 2003 showing direction dropdown

The expanded Find dialog in Word 2007 showing direction dropdown (similar in Word 2010 and 2013)

Figure 4. The expanded Find dialog in Word 2007 showing direction dropdown (similar in Word 2010 and 2013)

  1. The second way is to close the Find dialog and use the Browse buttons (Figure 5) to search Up or Down. The Browse buttons are the double arrows at the bottom of the vertical scroll bar.

The Browse buttons in Word 2003

Figure 5. The Browse buttons in Word 2003

By default, the Browse arrows are colored black and have the function Previous Page and Next Page. After you have used the Find dialog, however, they are colored blue and have the function Previous Find/GoTo and Next Find/GoTo. This can be very convenient when you want to close the Find dialog (so that it is not obscuring part of your document) and still continue searching.

Helpful Tip: It will often happen that you want to restore the function of the arrows to Previous Page/Next Page. To do this, click on the round button between the arrows (Select Browse Object). This will display a gallery of options (some of which will be discussed later). Choose Browse by Page.

Important Note: The browse arrows have been removed from the scroll bar in Word 2013. Although some of the “browse objects” are available from the dropdown on the Search tab of the Navigation pane (see below), Previous/Next Find/GoTo is not included.

Finding formatting

Even if you’ve used the Find dialog to search for specific text, you may be unaware that you can search for all text that has specific formatting. This can be accomplished through the expanded Find dialog.

  1. Click More (if necessary) to expand the dialog.

  2. In the bottom left corner, click Format. As you can see from Figure 6, you have several choices of formatting; more than one type can be applied.

he Format menu in the Word 2003 Find dialog (very similar in Word 2007 and above)

Figure 6. The Format menu in the Word 2003 Find dialog (very similar in Word 2007 and above)

Some of the formats you can search for can be entered with familiar keyboard shortcuts such as Ctrl+B (Bold), Ctrl+I (Italic), and Ctrl+U (Underline), but you will find that they have a slightly different result in the Find dialog. Instead of being straightforward on/off toggles, they have three states. If you press Ctrl+B once in the “Find what” box, you will get “Format: Bold.” Press it again and you will get “Format: Not Bold.” Press it a third time to clear the formatting (you can also click the No Formatting button to clear all formatting from the “Find what” box).

There are several common scenarios where being able to search for formatting can be helpful, as described below.

Replacing formatting

Often the purpose of searching for formatting is to find text with one format and replace the formatting with something else.

For example, you might want to search for underlined text and format it as italic:

  1. Click on the Replace tab of the dialog.

  2. In the (empty) “Find what” box, press Ctrl+U. You will see “Format: Font: Underline” under the box.

  3. In the “Replace with” box, press Ctrl+U twice, then press Ctrl+I. You will see “Format: Font: Italic, No underline.”

  4. Click Replace All.

Or you might want to find all the text that is 16-point Arial Bold and apply the Heading 1 style. There are actually two ways to do this. The first way is to actually replace the formatting:

  1. Select the Replace tab of the dialog.

  2. Click More to expand the dialog.

  3. With the insertion point in the “Find what” box, click Format, then Font and select Arial, Bold, and 16 points. Click OK.

  4. With the insertion point in the “Replace with” box, click Format, then Style, and select Heading 1.

  5. Click Replace All.

The Replace dialog

Figure 7. The Replace dialog

The second way is to use the Find dialog’s ability to select all the search results at once. Note: This feature is found only in Word 2002 and above.

  1. With the Find tab selected, click More to expand the dialog.

  2. With the insertion point in the “Find what” box, click Format, then Font and select Arial, Bold, and 16 points. Click OK.

  3. In Word 2002 or 2003, check the box for “Highlight all items found in,” choose the appropriate document layer, and then click Find All (see Figure 8).
    In Word 2007 and above, click Find in and select the appropriate document layer (see Figure 9).

Word 2003 Find dialog showing Find All

Figure 8. Word 2003 Find dialog showing Find All

Word 2007 Find dialog showing Find in

Figure 9. Word 2007 Find dialog showing Find in

Important Note: If you have previously used “Highlight all items found” in Word 2002 or 2003, you may be confused by the “Reading Highlight” in the  Find dialog in Word 2007 and above. Clicking this button applies the current Highlighter color to all the search results but does not actually select them. For that, you need to use Find in.

  1. Once the Find dialog has selected all the search results, press ESC or click Cancel to close the dialog (or click on the document’s title bar to return focus to the document without closing the dialog). Do not click in the document, as this will deselect the selected text.

  2. Use the Style dropdown or the Styles and Formatting task pane to apply the Heading 1 style.[1]

Copying selected text to another document

Users often ask to copy all the results of a Find operation and paste them to a new document. Obviously, if you were just searching for a specific word, you would not want to paste it umpteen times. Where this comes in handy is when you are searching for all the text that has a certain pattern (for example, using No. ^#^# to search for the text “No.” followed by two digits) or when you’re searching for specific formatting (such as all italicized text).

For this you can use Find All or Find in as described in the previous section.

  1. Once the Find dialog has selected all the search results, press ESC or click Cancel to close the dialog (or click on the document’s title bar to return focus to the document without closing the dialog). Do not click in the document, as this will deselect the selected text.

  2. Click the Copy button or press Ctrl+C to copy the selected text. Then create a new document and Click Paste or press Ctrl+V to paste the copied text. Each search result will be in its own paragraph.

Blank results of StyleRef fields

In this scenario, you have inserted a StyleRef field in the document header (perhaps to pick up a given heading level), but the result of the field is blank. Or perhaps you have inserted a table or figure caption using the “Include chapter number” option, which relies on a StyleRef field to provide the paragraph number of the selected heading style, but captions are showing 0 instead of the expected heading number.

The cause in both cases is almost always the existence of an empty paragraph in the referenced style. This can be a result of pressing Enter twice following the paragraph the StyleRef field is meant to reproduce. This is less likely to be a problem if that paragraph is in one of Word’s built-in heading styles, because the “Style for following paragraph” of all heading styles is Normal (for this reason, problems with captions are relatively rare). But if your StyleRef field refers to some other style, then pressing Enter at the end of the paragraph will produce another paragraph in the same style. If that paragraph is left empty, then it is the one the StyleRef field sees.

It is usually not too difficult to visually scan your document for such empty paragraphs (with nonprinting characters displayed), but sometimes they can be extremely elusive, and this is when it can be much more effective to use the Find dialog to search for paragraphs in the referenced style.

For example, I examined one document in which users were expected to type information (a person’s name, for example) in a table cell formatted with a specific style, and that name was repeated later in the document using a StyleRef field referencing that style. The only problem was that the StyleRef field was coming up blank.

At first blush, it appeared that everything was as it should be. But then I used Find to search for the referenced style and realized that it was being found twice, once in a paragraph I could see and again in one that wasn’t visible. At this point, with nonprinting characters displayed, I realized I was seeing something I shouldn’t be seeing in the table cell: a paragraph mark. The user who had typed in the cell had absent-mindedly pressed Enter at the end of the entry. This created an empty paragraph (terminated by the end-of-cell marker) in the referenced style. The only problem was, that paragraph wasn’t visible because the table row had been set to an exact height that permitted only one line of text to be displayed. Once I deleted the paragraph break, the StyleRef field behaved as expected.

Other useful things to find

Missing or invisible footnotes/endnotes

In another scenario, you may be having problems with footnote or endnote numbering that is incorrect. There are a couple of preliminary issues to check on:

  •  If you are using Track Changes, then the numbering will not sort itself out until you have accepted all the changes.

  •  If you feel you have two footnotes with the same number, increase your Zoom ratio and examine the reference numbers more carefully. Because of the dotted line around the numbers, footnote/endnote 6 can look convincingly like 5.

If neither of these is the problem, and especially if you have an empty paragraph between two notes that you are unable to delete, then the cause is usually a footnote reference left in the document body after the footnote text, together with the reference mark, has been deleted.

If some of the footnote reference marks have been formatted as Hidden in order to combine several notes (for example, to show “22–24” instead of “22, 23, 24”), it will usually suffice to display Hidden text (using the Show/Hide ¶ button) and look in the appropriate place. But sometimes note references can also be elusive, especially if the document creator has inserted a note with a funky “custom” reference mark, such as a space.

When that happens, you can search for the note using the Find dialog.

  1. Expand the dialog, if necessary, by clicking More.

  2. Click Special to display the list of special items you can search for (see Figure 10).

The Special menu in the Find dialog in Word 2003 (identical in Word 2007 and above)

Figure 10. The Special menu in the Find dialog in Word 2003 (identical in Word 2007 and above)

  1. Choose Endnote Mark or Footnote Mark. Note that Word will insert ^e for an endnote mark or ^f for a footnote mark. If you remember these codes, you can type them in directly (type the ^ directly from the keyboard; on U.S. keyboards it is Shift+6).

  2. Click Find Next until you reach the location of the elusive reference mark. Possibly there will be nothing there to see. If that’s the case, select a character or two on either side of the position where Find stopped and delete them; then retype the deleted characters.

Helpful Tip: You can also search for footnote and endnote reference marks using the Browse buttons. Click on the Select Browse Object button and choose Browse by Endnote or Browse by Footnote, then click the up or down arrows to go to the previous or next reference mark.

Helpful Tip for Word 2010 and 2013: "Footnotes/Endnotes" are among the "additional search commands" available on the magnifying-glass menu in the Navigation Pane, along with Graphics, Tables, and Equations. In Word 2013, which has no Browse buttons, you will have to use this feature.

Elusive section breaks

In this scenario, you are having problems with page numbering or formatting that appears to be caused by an elusive section break. Usually you can spot section breaks more easily if you switch to Normal view (Draft view in Word 2007 and above) and display nonprinting characters, but occasionally they will still hide successfully.

In such cases you can use the Find dialog to search for section breaks (you can also search for manual page breaks).

  1. Expand the dialog, if necessary, by clicking More.

  2. Click Special to display the list of special items you can search for.

  3. Choose Section Break. Note that Word will insert ^b. If you remember this code, you can type it in directly (type the ^ directly from the keyboard; on U.S. keyboards it is Shift+6). The code for a manual page break is ^m.

Helpful Tip: You can also search for section breaks using the Browse buttons. Click on the Select Browse Object button and choose Browse by Section, then click the up or down arrows to go to the beginning of the previous or next section. The section break will be just before the location where the insertion point lands. There is no equivalent for this in Word 2013, which does not have Browse buttons.

Text that has been skipped by the spelling checker

This scenario is one of the most intriguing I have ever encountered. A user, upon running the spelling checker, kept getting the message shown below.

Spelling checker message box

Figure 11. Spelling checker message box

The user had done everything right: she had used Ctrl+A to select the entire document, then gone to Tools | Language | Set Language (Review | Proofing | Set Language in Word 2007; Review | Language | Set Proofing Language in Word 2010 and 2013) and made sure that the “Do not check spelling or grammar” box was clear. Knowing that Ctrl+A selects only the main document layer, she had also made sure that all the text of the header and footer and the content of any text boxes had been cleared of culpability. But she continued to get this message. Where was the text that was being skipped?

When I examined the document, I used Find to search for this elusive text. As described above in “Finding formatting,” I used Format | Language to specify “Do not check spelling or grammar.” The result was mystifying. Instead of selecting a search result in the document itself, Word opened a pane at the bottom of the window, similar to the footnote or comments pane (see Figure 12). I have subsequently learned that Word routinely does this if you begin a search from the document layer and the search result is in a header or footer. (Ironically, in this case, a search begun from the header would not have found the elusive text.)

Results of search for “Do not check spelling or grammar”

Figure 12. Results of search for “Do not check spelling or grammar”

It took me quite a while to realize what I was seeing. At the top of the pane was the description “First Page Header.” The document in question did not have “Different first page” enabled for headers and footers, so the document did not have a visible First Page Header. At some time, however, someone had created a First Page Header in that document, and, although it was no longer in use, Word still knew about it, and it contained text that was formatted as “Do not check spelling or grammar.” When this text was deleted from the header (which had to be enabled temporarily for the purpose), the problem was solved, and the message no longer appeared.

 

[1]In Word 2002 and 2003, you can accomplish the same thing using the Styles and Formatting task pane, but only if you have “Keep track of formatting” enabled in Tools | Options | Edit. Click in a paragraph with 16-point Arial Bold formatting, right-click on “Arial, 16 point, Bold” in the task pane, and click on “Select all x instances.” Then click on Heading 1 to apply the style to all the selected text.

In Word 2007 and above you can use the same procedure in the Styles task pane, but again you must have some options enabled: click Options at the bottom of the task pane to open the Style Pane Options dialog. Under “Select formatting to show as styles,” you would, in this example, have to have at least “Font formatting” checked.

Note, however, that the Replace method will work in any version, regardless of what style pane options you have enabled, and of course you still need to use Replace to replace formatting that is not defined as a style.

This article copyright © 2010, 2011, 2014 by Suzanne S. Barnhill.