Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / April 2005

Tip: Looking for answers? Try searching our database.

Imbedded MERGEFIELD in IF/ELSE/THEN field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rich - 18 Apr 2005 22:45 GMT
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
Postnet Barcode for the ZipCode for a USA address.

I've attempted to create an IF/ELSE/THEN field as follows:

{ IF {MERGEFIELD country } = "USA" "{ BARCODE { MERGEFIELD zipcode} \U }" "{
MERGEFIELD country }"}

When I merge the data, it performs the IF test properly, and also properly
prints the country name for the non-USA entries.  However, I can't seem to
get the USA portion of the IF test to work properly -- rather than printing
the barcode for the associated zipcode, it just leaves it blank.

Is this sort of nesting/imbedding not capable?
Peter Jamieson - 19 Apr 2005 07:58 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.