Discussion:
Changing default printer.....
(too old to reply)
Pete Smith
2006-02-09 17:34:53 UTC
Permalink
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
jvb
2006-02-09 18:10:01 UTC
Permalink
Try opening a PrintDialog box and setting it's return value equal to
the printer that the user selects.
Pete Smith
2006-02-09 19:04:32 UTC
Permalink
Sorry I forgot to mention. It is an automated program. No manual
intervention.
-Pete
Post by jvb
Try opening a PrintDialog box and setting it's return value equal to
the printer that the user selects.
Cerebrus99
2006-02-06 21:12:22 UTC
Permalink
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.
Eric Moreau
2006-02-11 16:22:54 UTC
Permalink
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/
Post by 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
r***@gmail.com
2012-07-10 07:02:21 UTC
Permalink
Post by 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
Thank you so much.. It's a big help for my project here in our company.. Be bless.. :D
Loading...