×
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!
  • Students Click Here

*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

Barcodes to Zebra6m via VB.Net

Barcodes to Zebra6m via VB.Net

Barcodes to Zebra6m via VB.Net

(OP)
Hi

I was wondering whether someone could please help me?

I am trying to print a barcode to a Zebra6m 300dpi printer from a VB application.  From UNIX if i print a file with the following contents i get a barcode.

^XA
^FO540,175^B3N,N,100,Y,N^FD 69^FS
^XZ

So logically i thought if i print this from Windows i will again get the barcode, but i dont.  I just get those three lines printed in full.  

I wondered whether its just VB adding something in, as i also had to declare a font.  So i tried this through DOS Edit and again i get the 3 lines printed perfectly but no barcode.

Could someone please tell me why this is happening?

Thanks

RE: Barcodes to Zebra6m via VB.Net

so you have this
a file with the above code in it?
call it myfile.txt OK

then you go to DOS
and type
COPY C:\MYFILE.TXT LPT1:

DougP, MCP, A+

RE: Barcodes to Zebra6m via VB.Net

(OP)
Thanks for replying.

I tried what you have suggested and it works perfectly.  I retried printing it from Dos EDIT and this time it worked as well, so i presume i must of done something wrong last time i tried it! doh!

Taking this into mind, could you please advise me on how i can get this working with VB?  I presume it must be to do the fact i have to specify a font.

Thanks again.

RE: Barcodes to Zebra6m via VB.Net

(OP)
I still cant get the barcode to print to via VB.  Has anyone got any suggestions pls?

RE: Barcodes to Zebra6m via VB.Net

(OP)
Sorry just to clarify, i can print the barcodes from VB by creating a file then copying this to LPT1: but personally i think thats a slow way of doing it, also very unprofessional like.

Thanks for any idea's in advance.

RE: Barcodes to Zebra6m via VB.Net

What windows printer driver is being used?
Perhaps the driver is the problem...

RE: Barcodes to Zebra6m via VB.Net

(OP)
Thanks.

Under Driver it just says
'Zebra Z6M Plus (300dpi)' but that is also the name assigned to the printer.  I dont know if thats an issue or not?

Would it not use the Windows Print Driver when i copy the file to the printer then?

RE: Barcodes to Zebra6m via VB.Net

Jay1b,
You are right it is not very elegant but it works.
I have used it for years, and there are a few things to make it better. One is to hide the DOS box you are shelling to.    

CODE

x = Shell(File1, vbMinimizedFocus)
Also when you are doing this method you don’t need a Windows printer driver you are sending ZPL (Zebra Programming Language) directly to the printer. Much faster since that’s what the printer wants to see anyway.

DougP, MCP, A+

RE: Barcodes to Zebra6m via VB.Net

(OP)
Thanks.  Looks like i will just have to do it that way then.

I dont get a DOS box, literary i am just using 'File.Move (varfilename, "LPT1:")'.  I should clarify this is in VB.Net 2003.

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