WD: Incorrect Results Using Backslash in Conditional MergeLast reviewed: February 18, 1998Article ID: Q176620 |
The information in this article applies to:
SYMPTOMSWhen you use a conditional MergeField for a result that includes quotation marks, the result of the field will contain a backslash. For example, if you have the following conditional statement in your mail merge main document which uses backslashes to have quotation marks appear in the result of a true condition for a record
{IF {MERGEFIELD name} = "John Doe" "\"Now is the time...\"" "false condition"}you would expect to receive the result of "Now is the time" on a true statement. However, Word will give you the following result:
"Now is the time...\"NOTE: This problem may also occur with commas or backslashes.
WORKAROUNDTo work around this problem, use a unique character in place of the quotation mark. After the merge is completed, use the Replace command to search for the unique character and replace it with a quotation mark. (Note that the character you choose should not occur elsewhere in your document.)
ExampleIn the merge field, use the pound sign instead of quotation marks.
{IF {MERGEFIELD name} = "John Doe" "#Now is the time...#" "false condition"}After the merge is completed, follow these steps to replace the pound sign with a quotation mark:
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONThe general syntax for a conditional {IF} field is as follows:
{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. 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 should have a format of:
{IF {MERGEFIELD name} = "John Doe" "John said, \"The file was on f:\\harddrive\\my documents\"" "false condition"}Note that the actual result of this field will be
John Doe said, \"The file was on f:\\harddrive\\my documents\"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 Appear in Field ResultFor additional information about this situation in earlier versions of Word, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q:146648 TITLE : WD: How to Use Quotation Marks in a Conditional Merge Result |
Additional query words: quote mail merge else print condition word8 word97
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |