Home All Groups Group Topic Archive Search About

Changing default printer.....

Author
9 Feb 2006 5:34 PM
Pete Smith
I am using the PrintDocument for my print application.

Currently it is printing to the default printer.

How to change to a different printer?

VB.Net 2003 & .Net Framework 1.1.

Thank you,

Pete

Author
9 Feb 2006 6:10 PM
jvb
Try opening a PrintDialog box and setting it's return value equal to
the printer that the user selects.
Author
9 Feb 2006 7:04 PM
Pete Smith
Sorry I forgot to mention. It is an automated program. No manual
intervention.
-Pete


Show quoteHide quote
"jvb" <gome***@gmail.com> wrote in message
news:1139508601.387167.122930@z14g2000cwz.googlegroups.com...
> Try opening a PrintDialog box and setting it's return value equal to
> the printer that the user selects.
>
Author
6 Feb 2006 9:12 PM
Cerebrus99
Hi Pete,

If there is no user intervention possible, You can use the
PrintDocument.PrinterSettings property, through which you can specify
several Printer settings.
---------------------------------------
Dim pd As New PrintDocument()

' Specify the name of the printer to use.
pd.PrinterSettings.PrinterName = MyPrinter

'Set the no. of copies to print
pd.PrinterSettings.Copies = 2

'Set the range of pages to print
pd.PrinterSettings.PrintRange = PrintRange.AllPages

If pd.PrinterSettings.IsValid then
  pd.Print()
Else
  MessageBox.Show("Printer is invalid.")
End If

---------------------------------------

If you don't know the names of the installed printers, you can get it from
the PrinterSettings.InstalledPrinters collection.

Regards,

Cerebrus.
Author
11 Feb 2006 4:22 PM
Eric Moreau
See my article of March 2005 at http://emoreau.s2i.com/

--


HTH

Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Concept S2i inc. (www.s2i.com)
http://emoreau.s2i.com/

Show quoteHide quote
"Pete Smith" <PeteSmit***@hotmail.com> wrote in message
news:OYmI37ZLGHA.2276@TK2MSFTNGP15.phx.gbl...
>I am using the PrintDocument for my print application.
>
> Currently it is printing to the default printer.
>
> How to change to a different printer?
>
> VB.Net 2003 & .Net Framework 1.1.
>
> Thank you,
>
> Pete
>
>