Microsoft KB Archive/68206

Word: Suppressing “Search Text Not Found” Dialog Box in Macro

PSS ID Number: Q68206 Article last modified on 11-02-1994

5.50 6.00

MS-DOS

= SUMMARY =

Word version 5.50 will return the following message in a dialog box when search text is not found within the document:

The text you specified was not found.

The message dialog box will be displayed until you press ENTER or ESCAPE. This is different from Word 5.00, which displayed the message at the bottom of the screen with no response required for Word to continue operating.

This change affects macros that search or search and replace text that is not contained within the document or the selection. To suppress the search text not found dialog box, use the NOTFOUND macro function as described on page 466 of the “Using Microsoft Word” version 5.50 manual.

Example
ESsearch text <> <>

<< = left chevron or CTRL+[ >> = right chevron or CTRL+]

The above macro will search for the text string “search text.” If the text is not found within the document or selection, the ENTER key is inserted so that the message dialog box does not appear. If the “search text” string is found, the dialog box will not appear and the ENTER key will not be inserted.

KBCategory: kbother kbmacro KBSubcategory: Additional reference words: ============================================================================= Copyright Microsoft Corporation 1994.