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.
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.