WD2000: Cannot Merge a Barcode Field Based on a Condition

ID: Q212178


The information in this article applies to:
  • Microsoft Word 2000


SYMPTOMS

A BARCODE field nested in an IF field produces no merge result even when the condition is true.

For example, if you use an IF statement similar to the following, the BARCODE field is not created and no error message appears:

{IF {MERGEFIELD Zip} = "98052-6399" "{BARCODE Address \b \* MERGEFORMAT}<P>
{MERGEFIELD Name}<P>
[{MERGEFIELD Address}<P>
{MERGEFIELD City}{MERGEFIELD State}{MERGEFIELD Zip}] "The Zip Code Does Not Match"}
NOTE: "<P>" indicates pressing ENTER and "[" and "]" indicate the Address bookmark. To show bookmarks in your Word document, click Options on the Tools menu and then on the View tab, select the Bookmarks check box.


CAUSE

BARCODE fields are a special type of Word field called a "display" field. Display fields produce their own results and, unlike other Word fields, the result of a display field cannot exist independently of the field itself (display fields cannot be unlinked). Consequently, the result of a display field cannot be fetched by the IF field for its result.


WORKAROUND

To work around this problem, use either of the following methods.

Method 1

Use the Record Selection feature to merge only those records that you want to contain the postal bar code. After all those records have been merged, remove the BARCODE field and merge the remaining records.

For more information about how to select certain records from your data source, click Microsoft Word Help on the Help menu, type record selection in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

Method 2

Sort the data file by the country field so that all records for the U.S. are together. Using the Mail Merge Helper, merge only the range of records that includes the country U.S. After all U.S. records have been merged, remove the BARCODE field and merge the range of records that includes countries other than the U.S.

For more information about how to sort the records in your data source, click Microsoft Word Help on the Help menu, type sort records in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.


MORE INFORMATION

For additional information about mail merge in Word, click the article numbers below to view the articles in the Microsoft Knowledge Base:

Q212329 WD2000: How to Start a Mail Merge
Q212322 WD2000: How to Design and Set Up Mail Merge Data

Additional query words: usa bar code

Keywords : kbdta kbfield kbmerge wd2000
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: November 17, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.