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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Default Printer

Status
Not open for further replies.

jcs1953

IS-IT--Management
Nov 28, 2007
53
US
Hi,
I'm using this code to list the avaliable printers on the client side in a dropdownlist:

For Each strPrinter As [String] In System.Drawing.Printing.PrinterSettings.InstalledPrinters
SelectPrinter.Items.Add(strPrinter)
Next strPrinter
Dim PD As New PrintDocument
SelectPrinter.SelectedValue = PD.DefaultPageSettings.PrinterSettings.PrinterName

I want the user to be able to choose the printer from the dropdownlist. I use this to print the page:

<A HREF="javascript:window.print()">Print</A>

How do I get the page to print to the selected printer?
Thanks
 
this doesn't work. your server code will only list printers associated with the server. the javascript will prompt the client's browser to print. the user must be prompted to print. from the print dialog they can make adjustments. There is no way to automate this as that would create a security vulnerability. You might be able to do this with silverlight though.

this works on your local box for development because the server and client are the same box.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Darn! Oh well. Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top