How to Direct Printing to LPT1 in VB2005

Rexy

Member
Joined
Jan 16, 2007
Messages
14
Programming Experience
1-3
In VB 6.0 This code worked fine.:

Open "LPT1:" for output as 1

print #1, "Test Print"

Close 1

How to do it in vb2005??.

Why printing direct, becourse its a special POS Line printer.
 
Have a look at this: COM port made simple with VB.NET
There is a LPT class attached, it should be as simple as using the class to open/write bytes/close. Getting bytes from string can be done with one of the System.Text.Encoding and its GetBytes method.

Another option perhaps not very elegant is to execute DOS commands where you redirect output to LPT1 (using ">LPT1")

I can't help you any more now, but I will probably get hold of a parallel port printer and try it out some day.
 
Back
Top