Microsoft Knowledge Base |
|
WD: Blank Spaces Not Suppressed During Conditional Mail Merge |
|
|
Last reviewed: August 4, 1997
Article ID: Q132205 |
|
The information in this article applies to:
SYMPTOMSIf you use the Mail Merge Helper to set up a main document and attach a data file, you can add conditional MERGEFIELD statements by choosing the Insert Word Field button. Using this option can produce incorrect results during the merge unless you add a space before the ending quotation mark after {MERGEFIELD title} in the true test and remove the space between the conditional MERGEFIELD field and the subsequent MERGEFIELD field. Below is an example of how the field is incorrectly inserted into the document using this method:
{ if { MERGEFIELD title } <> "" "{ MERGEFIELD title }" "" } {MERGEFIELD
name}
STATUSMicrosoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
RESOLUTIONUnless you modify the conditional field so that the space is included as part of the conditional statement--instead of between the conditional field and the subsequent field--the result will be no space when the conditional field is true and one space before the subsequent field when the result is false. Condition 1: When the first field in a series of fields is the conditional argument, modify the conditional line so that it reads as
follows:
{if { MERGEFIELD title } <> "" "{ MERGEFIELD title }<space>"}
{MERGEFIELD name}
Condition 2: When the conditional field appears in the middle of a series
of fields, modify the conditional so that a space is included
in the true test immediately following {MERGEFIELD middle} but
before the ending quotation marks. The field should look like
this:
{MERGEFIELD firstname} {if{MERGEFIELD middle}<> ""
"{MERGEFIELD middle}<space>"}{MERGEFIELD lastname}
NOTE: A similar problem occurs in which Word does not suppress blank lines
in a conditional mail merge. For additional information on this topic,
please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q116360 TITLE : Blank Lines Not Suppressed During Conditional Mail Merge |
|
KBCategory: kbusage
©1997 Microsoft Corporation. All rights reserved. Legal Notices. |