473,769 Members | 5,846 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Huge problem with printing from ASP to network printer

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("S cripting.FileSy stemObject")
Set objWSHNet = CreateObject("W Script.Network" )
objWSHNet.AddPr interConnection "LPT1:", path, False,login, pwd
else
objWSHNet.AddPr interConnection "LPT1:", path, False
end if
Set objPrinter = objFS.CreateTex tFile("LPT1:", True)
....
objPrinter.Writ e("simple printing test")
objPrinter.Clos e
'---------------------------------------------------
2. - i would like to get dynamically the printer name as also its path...how
can i do this ?

thanks in advance,
Maileen.


Jul 19 '05 #1
1 4721
Maileen wrote on 08 jul 2004 in microsoft.publi c.inetserver.as p.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("S cripting.FileSy stemObject")
Set objWSHNet = CreateObject("W Script.Network" )
objWSHNet.AddPr interConnection "LPT1:", path, False,login, pwd
else
objWSHNet.AddPr interConnection "LPT1:", path, False
end if
Set objPrinter = objFS.CreateTex tFile("LPT1:", True)
...
objPrinter.Writ e("simple printing test")
objPrinter.Clos e
'---------------------------------------------------
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)
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3197
by: Daniel Iwan | last post by:
Hello everyone! I have a problem with using TCanvas Printer and network printer HP LaserJet It print just first page and throws blank all the rest. WinNT with Borland Builder 5. All works fine with my HP 3820 with USB printer (WinXP)
1
2602
by: Pohihihi | last post by:
Hello NG. I am using System.Drawing.Printing NS to print few label style printouts. I figured out how the basics goes in that namespace but there are still few things that is holding me up from completing my work. Basic problem is that when I select to print many copies or collate printout then nothing happence. It prints the first page and stops. Also I get different information regarding printer's capacity (please see below). Example...
1
3142
by: Maileen | last post by:
Hi, 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 :( could you help me please ? thx, Maileen. '---- to print report on network printer --- ' RSP = stored procedure
2
4648
by: alan | last post by:
I'm now using vb.net to write a POS system with a epson thermal printer. I use the ocx that provided by Epson to drive the printer. It's not the problem if I just using 1 computer vs 1 thermal printer. But now I need to use 2 computer vs 1 thermal, how can another computer use the same printer? I wonder I can send the print request and content to the computer which connecting to the printer by TCP/IP, but I don't know how to do that!
0
2077
by: Dawn | last post by:
My application is coded to create a report using Excel and I would like to send it directly to a pre-determined network printer. (My intention is to pass the printer name in a variable.) However, there is a suffix that is added to the printer name and the printer suffix is not consistent ...... "on Ne00" on my pc "on Ne01" on another pc Is there a way to consistently code the printer name ? mxlApp.ActivePrinter = "Dell Laser...
3
6319
by: Mika M | last post by:
Hi all! I have made an application for printing simple barcode labels using PrintDocument object, and it's working fine. Barcode printer that I use is attached to the computer, and this computer has drivers installed for this printer, and this printer is shared for the network. Question 1:
0
1231
by: Lars | last post by:
I am using Microsoft .NET (2.0) PrintPreviewDialog and all works well when the Windows default printer is set to a local printer or a network printer on a Windows server, but if I set it to a Samba network printer, it slows down to a crawl. With a Windows server network printer, it takes about 10 seconds to render 100 pages. With a Samba network printer, it takes over 5 minutes! I can see that the preview control is generating
3
2786
by: =?Utf-8?B?TWFyazYyNA==?= | last post by:
I have a web method that renders a SQL Reporting Services report and prints it to a network printer using the System.Drawing and System.Drawing.Printing namespaces in .Net 2.0. This method has been working without issues in production at several client sites but now I've started seeing memory errors when trying to print. The only way to resolve the errors has been to do an IISReset on the web server hosting the web service. I tried...
1
1853
by: Alex | last post by:
Hi, I'm writing an app to run on a server, hopefully autmated, and every 5 minutes it needs to hit a database and if any new records have been entered, print the record to a printer depending on certain criteria. I'm not sure if I'll handle timing through the app or through Windows Scheduler... but that's outside my question here. All our printers are Jetdirect compliant printers and on our network as \\printserver\printername or I...
0
9586
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10043
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9990
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3956
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.