Enter Zip Code results in Bar Code

S

Sammy

Hi,

In WordPerfect there is a feature where you can enter a zip code and it will
insert a bar code. You can be in any kind of document. In Word (2003) I
know how to get a bar code directly on an envelope or label through that
feature but can Word be automated to accept a zip code and insert the
appropriate bar code at the cursor in any document?

How do I go about finding the bar code methods and properties?

Thanks for any help, and as always your time is greatly appreciated.
 
J

Jay Freedman

The envelopes/labels dialog just inserts a BARCODE field, and you can do
that manually by using the Insert > Field dialog or through VBA by calling
ActiveDocument.Fields.Add with the proper field type. The field code
contains the keyword BARCODE followed by either the literal text of a zip
code or the name of a bookmark that includes the zip code.

Read the Help topic "Field codes: BarCode field" to find out about the
switches you can use.

There are two caveats: One, the field produces only a PostNet barcode, not
UPC or Code39 or any of the other types of barcodes. Two, the US Postal
Service no longer accepts barcoded mail for bulk-mail discounts
(http://support.microsoft.com/kb/897290).

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
P

Peter Jamieson

To insert the barcode for a ZIP, you need
a. the regional settings in Windows to be set to English (United States) .
Otherwise BARCODE fields do not work
b. You need to insert, and probably execute, a { BARCODE } field in one of
the following formats:

{ BARCODE \u "NNNNN" } for a 5-digit ZIP, where NNNN is the ZIP
{ BARCODE \u "NNNNN-NNNN" } for a 9-digit ZIP, where NNNNN-NNNN is the ZIP.
"NNNNNNNNN" will not work.

In VBA you could start with the following snippet:

objMyRange.Fields.Add objMyRange, wdFieldBarCode, "\u ""12345""", False

You have to use a field - it's a "display" field, which means that you
cannot convert it to a graphic result by selecting the field and replacing
it by its result using ctrl-shift-F9.

The main caveat to all this is that Word's BARCODE field has not kept pace
with the requirements/standards of the USPS, which also says that the only
benefit of using BARCODEs is when using one of their mass mailing discount
schemes (with the implication that properly-addressed mail with a ZIP will
be processed as quickly and reliably). But I leave you to research that for
yourself, especially as I'm on the other side of the pond and never use this
stuff myself.

Peter Jamieson
 
S

Sammy

THANK YOU BOTH FOR THE GREAT HELP

Peter Jamieson said:
To insert the barcode for a ZIP, you need
a. the regional settings in Windows to be set to English (United States) .
Otherwise BARCODE fields do not work
b. You need to insert, and probably execute, a { BARCODE } field in one of
the following formats:

{ BARCODE \u "NNNNN" } for a 5-digit ZIP, where NNNN is the ZIP
{ BARCODE \u "NNNNN-NNNN" } for a 9-digit ZIP, where NNNNN-NNNN is the ZIP.
"NNNNNNNNN" will not work.

In VBA you could start with the following snippet:

objMyRange.Fields.Add objMyRange, wdFieldBarCode, "\u ""12345""", False

You have to use a field - it's a "display" field, which means that you
cannot convert it to a graphic result by selecting the field and replacing
it by its result using ctrl-shift-F9.

The main caveat to all this is that Word's BARCODE field has not kept pace
with the requirements/standards of the USPS, which also says that the only
benefit of using BARCODEs is when using one of their mass mailing discount
schemes (with the implication that properly-addressed mail with a ZIP will
be processed as quickly and reliably). But I leave you to research that for
yourself, especially as I'm on the other side of the pond and never use this
stuff myself.

Peter Jamieson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top