print directly to the printer

  • Thread starter Thread starter Maverick
  • Start date Start date
M

Maverick

in basic there was a command "LPRINT" How can i print to
the printer directly?
 
Mav:

In VBA, what you do to print directly to the printer is use the Open and
Print (or put) statements. You open as a file the printer port as in:

PortOutput = FreeFile
Open "LPT1" For Binary Access Write As #PortOutput

Then use Put as in

Put #PortOutput, , Eval(YourStringVariableHere)

HTH
 

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

Back
Top