Microsoft KB Archive/71151: Difference between revisions
m (Text replacement - ">" to ">") |
m (X010 moved page Microsoft KB Archive/Q71151 to Microsoft KB Archive/71151 without leaving a redirect: Text replacement - "Microsoft KB Archive/Q" to "Microsoft KB Archive/") |
(No difference)
|
Latest revision as of 19:30, 12 August 2020
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:
<<IF selection = "^P">> {do some action} <<ENDIF>>
-or-
<<WHILE selection <> “^P”>> {do some action} <<ENDIF>>
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 "“. Use the reserved variable”selection" to check that the selected text is equal to "" (the endmark). The following are two examples:
<<IF selection = "">>…
<<WHILE selection <> "">>…
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.