Reply
 
Thread Tools Display Modes
  #1   Report Post  
Rich
 
Posts: n/a
Default Imbedded MERGEFIELD in IF/ELSE/THEN field

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?


  #2   Report Post  
Peter Jamieson
 
Posts: n/a
Default

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
"Rich" wrote in message
...
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?




  #3   Report Post  
Rich
 
Posts: n/a
Default

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

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I do a conditional mail merge into a table tomtraff Mailmerge 5 March 29th 05 05:29 PM
Enter data in 1 text form field & have multiple locations fill Lee Microsoft Word Help 1 March 16th 05 10:56 PM
Math In Merge Field(s) Kenny G Mailmerge 3 March 7th 05 06:57 PM
Zip code merging when 5 AND 9 digits Spring Velazquez, Widener University Mailmerge 13 January 21st 05 01:54 AM
Text Form Field Ref in Footer Won't Update on Screen StarWine Microsoft Word Help 3 December 6th 04 06:17 PM


All times are GMT +1. The time now is 08:06 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"