Direct acces to printer or ports

  • Thread starter Pasquale Marcantonio
  • Start date
P

Pasquale Marcantonio

I do not know how to Address and send Hex codes to a
Printer.

How do you open a printer port in VBA code, so you can
send escape coded commands to a special printed. I send
the hex codes to the printer in my report data, but all I
get is special character printed on the paper.
I know that in some cases you can setup hex codes in the
printer setup, but I need to change the hex codes on the
fly.

Point me in the correct direction.
 
A

Albert D. Kallal

It is been a long time since I tested this, but you can try:


Open "lpt1:" for output as 1

Print #1,chr$(4) & chr$(27);

close #1

The above code allows you to send chars direct to the printer. I have not
tried this for years now...but give it try.
 
Top