WD: Suppressing Blank Spaces in a Print Merge (Mail Merge)

Last reviewed: July 30, 1997
Article ID: Q72441
The information in this article applies to:
  • Microsoft Word for Windows versions 1.0, 1.1, 1.1a
  • Microsoft Word for Windows, versions 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c
  • Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows 95, versions 7.0, 7.0a
  • Microsoft Word 97 for Windows

SYMPTOMS

When you perform a print merge (or mail merge) in Word for Windows, a blank space displays and prints if one field on a line is blank. A common example of this situation is a line with three name fields, such as the following:

   {FNAME} {MI} {LNAME}

In a record where all three fields are filled, the merged record spacing is correct, as in the following example:

   James R. Wood

In a record where the middle initial field {MI} is blank, an extra space occurs in the merged record, as in the following example:

   Susan  Peterson

Note: There are two spaces between the {FNAME} and {LNAME} results.

RESOLUTIONS

Method 1

You can eliminate this extra space by using the following conditional statement:

   {FNAME} {IF {MI} <> "" "{MI} "}{LNAME}

Note: To enter the field characters ({}), choose Field from the Insert menu (or press CTRL+F9).

Method 2

The following conditional MERGEFIELD field will remove blank spaces in any field. For example, given the following fields

   {Prefix} {FirstName} {LastName}

the following conditional statements will properly suppress the space normally included for any blank fields:

   {IF {MERGEFIELD Prefix}<>"" "{MERGEFIELD Prefix} "}
   {IF {MERGEFIELD FirstName}<>"" "{MERGEFIELD FirstName} "}
   {IF {MERGEFIELD LastName}<>"" "{MERGEFIELD LastName}"}

REFERENCES

"Microsoft Word for Windows User's Reference," pages 97-98, and 200 "Microsoft Word for Windows and OS/2 Technical Reference," pages 41-42


KBCategory: kbusage
KBSubcategory: kbfield kbmerge
Additional query words: 1.x 2.x 2.0 winword2 7.0 word95 winword
word7 word6 2.0a 2.0a-CD 2.0b 2.0c 2.x 6.0 6.0a 6.0c 8.0 word8
word97 winword
Keywords : kbfield kbmerge kbualink97 kbusage
Version : 1.0 1.10 2.x 6.0 6.0a 6.0c 7
Platform : WINDOWS


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: July 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.