Private Sub GetMe()
Dim a As New Printing.PageSettings()
TextBox1.Text = a.PrinterSettings.PrinterName()
End Sub
'this will get a list of every printer setup on the current machine
Private Sub ListMe()
Dim a As New Printing.PageSettings()
Dim b As System.Drawing.Printing.PrinterSettings.StringColl ection =
Printing.PrinterSettings.InstalledPrinters
Dim X As Integer
For X = X To b.Count - 1
ListBox1.Items.Add(b.Item(X))
Next
End Sub
'this will make the selected printer the default printer
Private Sub ChangeMe()
Dim a As New Printing.PageSettings()
a.PrinterSettings.PrinterName = ListBox1.SelectedItem
End Sub
--
Get a powerful web, database, application, and email hosting with KJM
Solutions
http://www.kjmsolutions.com
"c_shah" <sh*********@netzero.net> wrote in message
news:11**********************@y43g2000cwc.googlegr oups.com...
How to change and set default printer using Visual Basic 2005
The following works within my VB 2005 application but does any one have
better alternative.
/****
Dim wshnetwork As Object = CreateObject("WScript.Network")
Dim printerpath As Object = "TIFF Image Printer 7.0"
wshnetwork.SetDefaultPrinter(printerpath)
**/