WD: How to Use Quotation Marks in a Conditional Merge Result

Last reviewed: February 5, 1998
Article ID: Q146648
The information in this article applies to:
  • Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c
  • Microsoft Word for the Macintosh, versions 6.0, 6.0.1, 6.0.1a
  • Microsoft Word for Windows NT, version 6.0
  • Microsoft Word for Windows 95, version 7.0, 7.0a

SUMMARY

This article describes how to define a conditional mergefield for a result that includes quotation marks. Normally, a conditional {IF} field takes the following syntax:

   {IF {MERGEFIELD name} = "John Doe" "true condition" "false condition"}

Note that quotation marks are used to denote the parameters of the conditional statements, and are not included in the printed result of the merge. If you want to include quotation marks in your result, you must include a backslash (\) before each quotation mark that you want to include.

For example, if you want to print "Now is the time...," (with the quotation marks) in your document when the true condition is met, you must place a backslash before each quotation mark. The conditional statement should look similar to the following:

   {IF {MERGEFIELD name} = "John Doe" "\"Now is the time...\"" "false
   condition"}

MORE INFORMATION

The comma also has a special use inside the {IF} field. Therefore, use the backslash before a comma as well as before the quotation mark.

In addition, the backslash has a special use inside the {IF} field. Therefore, use a backslash before a backslash. In other words, use two backslashes if you want one to appear in the merged document.

For example to have the result "John said, "The file was on f:\harddrive\ my documents"", the {IF} field would have a format similar to this:

   {IF {MERGEFIELD name} = "John Doe" "John said, \"The file was on
   f:\\harddrive\\my documents\"" "false condition"}

For additional information about this issue, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q134998
   TITLE     : WD: Certain Characters Do Not Display in Field Result


Additional query words: quote mail merge else then print mark comma
condition
Keywords : kbfield kbmerge macword ntword winword
Version : WINDOWS:6.0,6.0a,6.0c,7.0,7.0a;MACINTOSH:6.0,6.0.1,6.0.1a
Platform : MACINTOSH WINDOWS
Issue type : kbinfo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 5, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.