Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help! Printer/Network/DOS 1

Status
Not open for further replies.

mandarine

Programmer
May 20, 2000
19
0
0
FR
Hello,

I have a network of two computers with one printer each.
If I use this code:

open "lpt1:" for output #1
print #1,"This is a DOS printer"
close #1

it will print in computer 1 that have a DOS printer,
but I want to print in my other computer (computer2)
that have also a DOS printer.

How do I do it in VB?

 
You will need to set up the printer that is attached to to comp1 as a network printer on comp2.If you want to print to this network printer in the same fashion that you have demonstrated, then while seting up this printer you will have to 'Capture printer port' and set it to lpt2. You can then access this printer as

open "lpt2:" for output #1
print #1,"This is a DOS printer"
close #1


David Paulson


 
the only problem with this approach is when the printer is unavailable (off line, not connected etc). A good work around is writing directly to the spooler. Damned if I can remember where I found the code but try support.microsoft.com/support first ... else ... email me and i will send you the code.

regards

ciaran

ciaran
ciaranr@albany.jrc.net.au

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top