How to get the name of default printer? .. please help
thanks
Winanjaya
Printable View
How to get the name of default printer? .. please help
thanks
Winanjaya
Like this :
VB Code:
Dim P_Name As New PrintDocument MessageBox.Show(P_Name.PrinterSettings.PrinterName())
VB Code:
Dim Settings As New System.Drawing.Printing.PrinterSettings() Dim strPrinter As String = Settings.PrinterName
Ok , if you don't want to create any obj , then use the static class PrinterSettings .Quote:
Re: Keeps you from having to create a PrintDocument
VB Code:
Printing.PrinterSettings.InstalledPrinters.Item(0)
will that return you the default printer, or just the first of your installed printers?
I've just tested it here and it returns the default printer name even if it's the last one installed .
OK, cool. Even fewer lines of code.
You really are a pirate, aren't you ? ;)