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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Barcodes to Zebra6m via VB.Net 1

Status
Not open for further replies.

Jay1b

Programmer
Apr 27, 2004
15
GB
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
 
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+
 
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.
 
I still cant get the barcode to print to via VB. Has anyone got any suggestions pls?
 
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.
 
What windows printer driver is being used?
Perhaps the driver is the problem...
 
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?
 
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+
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top