Print directly to LPT Ports

N

Norbert

Hi,

Within VBA, I am using

Open "LPT3:" For Binary Access Write As #1
.....

Put #1, , CByte(VBA_Generated_Data_Byte)
.....

to send data directly to a (network) printer. With Windows
2000 / NT 4.0, this works fine.

With Windows 98, I get an error message when I try to open
ports other than "LPT1:" or "LPT2:".

After successfully opening "LPT2:" or "LPT2:", the program
locks up when I try to send data to the open port
using "put" (can only be killed using task manager).

Has anyone an idea how to circumvent this problem?

Furthermore, I would like to select a network printer from
within the VBA code and then send data directly to it.
Apparently, the only way to do this is to use the "net
use" command from outside the VBA program (e.g. using DOS
window).

The problem is that the share name of the printer is not
available within the "Application.Printers" collection,
but it is needed to connect is with the "net use" command.

If it would be availabe, the network connetion could be
etablished from within VBA using the "Shell"-Command
("Shell "net use "LPT3:" ..."").

Has anyone an idea how to solve this problem??

Best regards

Norbert
 

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