How to do an international mail merge, with barcodes, from the US

Article contributed by George A. Clark

When you use the standard U.S. BARCODE field, if you try to mix International addresses with USA addresses, you'll get Zip code missing! or Zip code not valid! messages in place of the postal barcode for non-US addresses. Since it is not possible to include a BARCODE field in an IF field to avoid this, the workaround suggested by the Knowledge Base is to split your mailings into two groups. But there is a better alternative: include an IF field in the BARCODE field.

This can take one of two forms:

{ BARCODE { IF { MERGEFIELD Country } = "" "{ MERGEFIELD StreetAddress }
{ MERGEFIELD Zip }
" "¶
" } \u }

Or

{ BARCODE { IF { MERGEFIELD Country } = "" { QUOTE "\"{ MERGEFIELD StreetAddress }
{ MERGE FIELD Zip }
"\" } { QUOTE "\"¶
"\" } } \u  }

(the pilcrow [] represents a <carriage return>).

Both assume a USA resident who does not have country information entered for other US residents, but does have information in this field for those in other countries. You may need to adjust the test for your particular situation, and, of course, adjust the field names as needed.

Use the first form if you are doing an immediate merge where you will manually step through the records, or any merge where the field will be copied to each place where it is needed, or if merging to your printer.

Use the second form when you will be setting up only one record, and will then be merging to a new document; you will see errors in the main document, but they will be resolved when you perform the merge.

You will still get an error (Invalid Zip Code!) for US addresses if the zip code is malformed, or if it is missing but there is a street address. To avoid the latter case, you can use just the zip code field (as nearly as I can tell, this yields the same results as using both). However, getting the error message is helpful since it does alert you to the fact that you have an incorrectly entered or missing zip code; either will delay, or even prevent, delivery of your mail.

For all other cases, including International addresses that may or may not have a number in the Zip Code field, these will simply produce a blank line.