Write to LPT

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¹
 
A

Arvin Meyer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top