
Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> I am using Word and Excel to merge form letters and envelopes. The
> addresses that I use go to the US and outside the US. I want Word to
[quoted text clipped - 6 lines]
> { IF "{MERGEFIELD Country}" = "USA" "{BARCODE "{MERGEFIELD
> Street_Address} {MERGEFIELD City_State_ZIP}"\*MERGEFORMAT}" ""}
If I take the barcode field out of the IF statement, and place it by itself,
it will generate a bar code just like it should. So, I know that all my
settings for the barcode to work are correct. If I remove the barcode field
and replace it with a couple words, in the IF statement, the IF statement
works as normal. I'm wondering if Word does not allow a barcode field to be
placed inside an IF statement, and if it is possible, what is the correct
syntax to get it to deliver the expected results.
> Most of the correspondents in this newsgroup live outside the US, and thus
> do not use barcodes; however fellow contributor Peter Jamieson wrote the
[quoted text clipped - 54 lines]
> > { IF "{MERGEFIELD Country}" = "USA" "{BARCODE "{MERGEFIELD
> > Street_Address} {MERGEFIELD City_State_ZIP}"\*MERGEFORMAT}" ""}
Graham Mayor - 19 Aug 2004 13:58 GMT
I cannot see any mechanism that should prevent it from working, however it
may simply not be updating. Merge to a new document, select the lot (CTRL+A)
then press F9 to update. Does that improve things?

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> If I take the barcode field out of the IF statement, and place it by
> itself, it will generate a bar code just like it should. So, I know
[quoted text clipped - 74 lines]
>>> { IF "{MERGEFIELD Country}" = "USA" "{BARCODE "{MERGEFIELD
>>> Street_Address} {MERGEFIELD City_State_ZIP}"\*MERGEFORMAT}" ""}
Peter Jamieson - 19 Aug 2004 17:19 GMT
I see this problem in Word 2000, which is what is in front of me. Not sure
about other versions.
I suspect you may have to do something along the following lines:
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 fieldand ensure it's a point selection (i.e.no
text isselected) and insert a bookmark called NONUSA.Save the document
(let's say it is called c:\barcode\barcode.doc) andput the following fields
in your mergemain 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 } }
)

Signature
Peter Jamieson
> If I take the barcode field out of the IF statement, and place it by itself,
> it will generate a bar code just like it should. So, I know that all my
[quoted text clipped - 26 lines]
> >
> > (The ? is just a normal paragraph mark that you will see if you press
Enter
> > after { MERGEFIELD "street address" }
> > and click the ? symbol in Word's toolbar).
[quoted text clipped - 32 lines]
> > > { IF "{MERGEFIELD Country}" = "USA" "{BARCODE "{MERGEFIELD
> > > Street_Address} {MERGEFIELD City_State_ZIP}"\*MERGEFORMAT}" ""}