Huge problem with printing from ASP to network printer

Discussion in 'ASP General' started by Maileen, Jul 8, 2004.

  1. Maileen

    Maileen Guest

    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.
     
    Maileen, Jul 8, 2004
    #1
    1. Advertising

  2. Maileen

    Evertjan. Guest

    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.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Jul 8, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Amrendra Nath
    Replies:
    1
    Views:
    2,463
    Natty Gur
    Oct 21, 2003
  2. Samuel Lee
    Replies:
    0
    Views:
    544
    Samuel Lee
    Nov 11, 2003
  3. Maileen

    printing on network printer

    Maileen, Jul 7, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,074
    Stu Lock
    Jul 7, 2004
  4. Thomas Feuerstack
    Replies:
    1
    Views:
    907
    Thomas Weidenfeller
    Dec 14, 2005
  5. Maravilloso
    Replies:
    0
    Views:
    318
    Maravilloso
    Oct 26, 2005
Loading...

Share This Page