Input box and bar code field

S

Sammy

Hello,

I'm trying to create a macro that will prompt a user for a zip code (5 or 9
character) and then insert a bar code. Here's what I have so far:

Sub MyBarCode()

Dim MyZipCode As String

MyZipCode = InputBox("Enter Zip Code")

Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"BARCODE \u MyZipCode ", PreserveFormatting:=True
End Sub

The macro runs and I enter a valid zip code but here's what I get at the
cursor instead of a bar code:

'Zip Code Not Valid!

I think the "\u MyZipCode" is the problem but I don't know how to fix it.

Any help is appreciated. Thank you.
 
G

Graham Mayor

MyZipCode will never be a zip code in the field. Although we don't use
barcodes on this side of the pond

"BARCODE \u " & MyZipCode,

would probably be nearer the mark, however the barcode produced by Word is
POSTNET.

The USPS no longer accepts that format for bulk mail discounts -- see
http://support.microsoft.com/kb/897290. You might as well not use the
barcode feature at all.


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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