Microsoft KB Archive/71151

Word: Searching for Special Characters in a Macro

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

5.00 5.50 6.00

MS-DOS

= SUMMARY =

You can check or search for special characters from a Word macro by putting the special character code within quotation marks. The following example can be used to determine if the selection is a paragraph mark:

<> {do some action} <>

-or-

< “^P”>> {do some action} <>

A listing of the special character codes can be found in Chapter 10 of the “Using Microsoft Word” version 5.00 manual or Chapter 8 of the “Using Microsoft Word” version 5.50 manual.

The end-of-file (EOF) marker is recognized by Word as a null character, represented by &quot;“. Use the reserved variable”selection&quot; to check that the selected text is equal to &quot;&quot; (the endmark). The following are two examples:

<>…

< &quot;&quot;>>…

The first example carries out subsequent macro steps if “selection” is equal to the endmark; the second example carries out subsequent macro steps if “selection” is not equal to the endmark.

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