Microsoft KB Archive/52009

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Word: Using Quotation Marks in Macro Variable Strings

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

4.00 5.00 5.50 6.00

MS-DOS

SUMMARY

To place a quotation mark in a string used in a Microsoft Word macro variable, type two consecutive quotation marks ("").

For example, type the following to set the variable Quote equal to one quotation mark ("):

<<set quote="""">>

In this example, the first quotation mark tells the computer that the variable is going to be set to a string. The second and third quotation marks denote the text for a single quotation mark. The last quotation mark tells Word that the string is finished.

Type the following to set the variable Test equal to ‘The boss said “hello”’:

<<set test=“The boss said”“hello”"">>

In this example, the two quotation marks before the word “hello” are interpreted as a single quotation mark. The first two quotation marks after the word “hello” are also considered a single quotation mark. The third quotation mark after the word “hello” is the closing of the string.

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