The basic problem is that BARCODE fields do not work when they are nested
inside IF fields.
Before continuing, it's worth saying a few other things about BARCODE
fields:
a. they only work if you have selected USA as your country code in COntrol
Panel|Regional Settings
b. I am not in the US and do not use them, but I am told that the Microsoft
Word BARCODE field no longer generates USPS barcodes correctly (i.e. the
rules have changed). My understanding was also that you have to have a
street address in the data used to generate the barcode. There are articles
in the Microsoft Knowledgebase about this (go to
http://support.microsoft.com and search for Word, BARCODE, USPS etc.)
For example, you might need to use something like
{ BARCODE \u "{ MERGEFIELD street }
{ MERGEFIELD zipcode }" }
to generate your code, rather than just
{ BARCODE \u "{ MERGEFIELD zipcode }" }
In other words, you need to verify that your BARCODE field, however you
produce it, is producing a valid bar code.
To avoid using an IF field, you can try the following:
Create another Word document and copy/paste your BARCODE field in
there. Select it, and insert a bookmark called USA. Then put the insertion
point somewhere outside the field and ensure it's a point selection (i.e.no
text is selected) and insert a bookmark called NONUSA.Save the document
(let's say it is called c:\barcode\barcode.doc) and put the following fields
in your merge main document:
{ IF { MERGEFIELD Country } = "USA"
"{ SET barcodecountry USA }"
"{ SET barcodecountry NONUSA }"
}{ INCLUDETEXT "c:\\barcode\\barcode.doc" { REF barcodecountry } }
(Or if for example your data source has USA for the USA ones and NONUSA for
the others, you can avoid the IF and just try
{ INCLUDETEXT "c:\\barcode\\barcode.doc" { MERGEFIELD Country } }
)
Peter Jamieson
> Via MS-Word 2000, I'm trying to create a mail-merge address label template
> which will print the country name for a non-USA address, or will print the
[quoted text clipped - 13 lines]
>
> Is this sort of nesting/imbedding not capable?
Rich - 19 Apr 2005 13:14 GMT
> b. I am not in the US and do not use them, but I am told that the Microsoft
> Word BARCODE field no longer generates USPS barcodes correctly (i.e. the
> rules have changed).
Wow, if that turns out to be true, I'm gonna be *really* irritated for
having wasted so much time on this project. <sigh>
> There are articles in the Microsoft Knowledgebase about this (go to
> http://support.microsoft.com and search for Word, BARCODE, USPS etc.)
Thanks, I'll go see what I can find out.
-Rich