Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Zebra label print using VB 2

Status
Not open for further replies.

msk320

Programmer
Jun 7, 2004
5
0
0
CA
New to barcode label printing using VB 6.0. I have never worked on similar application before. would appreciate if some one can help me out with code or suggestion.
I have a zebra printer which has already been conigured and has an application running successfully.
I have to recode that application and tried to deploy but the printer is not responding. although the genric printers print but the Zebra 96 Xi III is not responding. any suggestion to the following code

Printer.FontName = "BC C39 Wide "
Printer.CurrentY = 300
Printer.CurrentX = 200
Printer.FontSize = 16
Printer.Print strLabelId 'Print the Barcode

'Set up the human readable text
Printer.CurrentX = 900
Printer.FontSize = 12
Printer.FontName = "Arial" 'Switch to a text font
Printer.Print strLabelId 'add a few spaces before the contents

'This tells the printer to eject the page
Printer.EndDoc
 
just a clarification The application that is running currently and printing successfully is just an exe so I don't have code for that. Now i re wrote the code one that is shown above but this one is not working on printer
 
yeah one more thing do we need to write ZPL for printing don't know anything about this
 
Thanks KIRBY2000

Things worked well with that.
The only problem i am facing is as follows
Sometimes I get missing lables
e.g
I printed 5 lables from VB to zpl file and then to shell prompt
CI876X2001
CI876X2002
CI876X2003
CI876X2004
CI876X2005

This is what was printed on label
CI876X2002
CI876X2003
CI876X2005


Wondering where did the other labels go
 
You need to put a pause in the VB code. It’s generating the labels too fast for the printer to keep up.

In your loop

Do
'shell to command prompt to print
TimeOut(1) ‘pause for one second
loop

'This sub is great for a simple wait seconds

Sub TimeOut(duration)
Dim starttime
starttime = Timer
Do While Timer - starttime < duration
DoEvents
Loop
End Sub


DougP, MCP, A+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top