Microsoft KB Archive/71151: Difference between revisions
m (Text replacement - "<" to "<") |
m (Text replacement - ">" to ">") |
||
Line 11: | Line 11: | ||
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: | 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"> | <<IF selection = "^P">> {do some action} <<ENDIF>> | ||
-or- | -or- | ||
<<WHILE selection < | <<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. | 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. | ||
Line 21: | Line 21: | ||
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: | 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 = ""> | <<IF selection = "">>… | ||
<<WHILE 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. | 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. | KBCategory: kbother kbmacro KBSubcategory: Additional reference words: ============================================================================= Copyright Microsoft Corporation 1994. |
Revision as of 10:50, 21 July 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.