×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Zebra label print using VB
2

Zebra label print using VB

Zebra label print using VB

(OP)
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

RE: Zebra label print using VB

(OP)
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

RE: Zebra label print using VB

(OP)
yeah one more thing do we need to write ZPL for printing don't know anything about this

RE: Zebra label print using VB

(OP)
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

RE: Zebra label print using VB

2
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+

RE: Zebra label print using VB

(OP)
Thanks DougP
Problem resolved

RE: Zebra label print using VB

did I solve it?

DougP, MCP, A+

RE: Zebra label print using VB

DougP

Thanks for the VB pause/wait routine.

Glen

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close