labelling

  • Thread starter Thread starter solo_razor
  • Start date Start date
S

solo_razor

hi,

does anybody know how i can write some code in visual basic that can
print something on a labelsticker using a zebra printer, where te
values are coming from an excelsheet. Also certain cells in this
sheet.

Regards,
 
I have a page on printing labels with Mail Merge in MS Word
from an Excel database. I imagine if you are set up to print
bar codes in Excel that all you need to do extra is to specify
the font for the barcode in your Word document for the field.
 
If you can loop through your desired fields, you can send the target
text to the zebra printer (I'm assuming local) via the LPT port of
your PC. There are other methods, but this is easiest.

Private Sub Command1_Click()
Dim strZPL As String
Dim lngFileNum As Long
Dim i As Long

'Loop through your excel sheet
'Assign a value to strReturn
strZPL = "^XA"
strZPL = strZPL & "^PF0^FS"
strZPL = strZPL & "^FT150,250^A0N,244,224^FD " & strReturn & "^FS"
strZPL = strZPL & "^XZ"

lngFileNum = FreeFile()

Open "LPT1" For Output As lngFileNum
'Open Printer.DeviceName For Output As lngFileNum
'Open "\\ARHTEST\ITTEST" For Output As lngFileNum
Print #lngFileNum, strZPL
Close lngFileNum

'Continue your loop

End Sub
 
Back
Top