WD: Cannot Merge a Barcode Field Based on a Condition

Article translations Article translations
Article ID: 212178 - View products that this article applies to.
This article was previously published under Q212178
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all

On This Page

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.

Properties

Article ID: 212178 - Last Review: February 28, 2014 - Revision: 2.1
APPLIES TO
  • Microsoft Word 2002 Standard Edition
  • Microsoft Word 2000 Standard Edition
Keywords: 
kbnosurvey kbarchive kbnofix kbmerge kbprb kbfield KB212178

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com