Write to LPT

  • Thread starter Thread starter Uros
  • Start date Start date
U

Uros

Does anybody know how to write data directly to the LPT port from MSAccess.

Now I use
"Open PrtPort For Append Access Write As IntFilenum" then
"Print $IntFilenum, ..........."
but doesn't work well. LPT port does not initialize and POS printer print
weird characters.
When user print blank page from notepade, on this time, printing from
MSAccess works fine until PC is restarted.

Anybody know solution or some other method for writing data to LPT?

Thanks!
Uro¹
 
Perhaps you are not telling it which LPT port to write to. You just open it
up like a regular file, print to it, then close it. I just tested this code
and it works fine:

Sub Output2Printer ()
Dim intFileNum As Integer

intFileNum = FreeFile

Open "LPT1" For Output As intFileNum
Print #intFileNum, "Hello World"

Close intFileNum
End Sub
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

If you're using a laser printer, you may need to press form feed to see the
output.
 
Back
Top