Huge problem with printing from ASP to network printer

M

Maileen

Hi,

I have 2 questions :

1. - I want to print from my ASP page directly to my network printer. For
this i
use the following code, but everytime, my document to print is sent to local
and physical port LPT1 not to network printer :(

'---- to print report on network printer ---
' path = "\\domain_name\Printer_name"
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objWSHNet = CreateObject("WScript.Network")
objWSHNet.AddPrinterConnection "LPT1:", path, False,login, pwd
else
objWSHNet.AddPrinterConnection "LPT1:", path, False
end if
Set objPrinter = objFS.CreateTextFile("LPT1:", True)
....
objPrinter.Write("simple printing test")
objPrinter.Close
'---------------------------------------------------


2. - i would like to get dynamically the printer name as also its path...how
can i do this ?

thanks in advance,
Maileen.
 
E

Evertjan.

Maileen wrote on 08 jul 2004 in microsoft.public.inetserver.asp.general:
1. - I want to print from my ASP page directly to my network printer.
For this i
use the following code, but everytime, my document to print is sent to
local and physical port LPT1 not to network printer :(

'---- to print report on network printer ---
' path = "\\domain_name\Printer_name"
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objWSHNet = CreateObject("WScript.Network")
objWSHNet.AddPrinterConnection "LPT1:", path, False,login, pwd
else
objWSHNet.AddPrinterConnection "LPT1:", path, False
end if
Set objPrinter = objFS.CreateTextFile("LPT1:", True)
...
objPrinter.Write("simple printing test")
objPrinter.Close
'---------------------------------------------------


2. - i would like to get dynamically the printer name as also its
path...how can i do this ?

It is not at all clear to me if you are trying to print to a printer on
the network of the server using ASP-vbs or to the printer on the client's
network using IE-vbs.

The former is not very usefull, as usually the client cannot see the
printer, because it can be continents away, [unobserved printers can
cause a fire ;-} ], and if you are incidentally on the same network you
could much better use IE client printing.

The latter is also not necessary as you can use IE client printing and
also that is OT on this NG, btw.
 

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

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top