HI!
Anyone knows how to set the windows default printer.
Printable View
HI!
Anyone knows how to set the windows default printer.
Hi
Use Printer.trackdefault Property
Good Luck
You could try the following:
dim pDefault as Printer
dim pPrinter as printer
dim PrinterName as string
' Save the original default
set pDefault = Printer
' Tell it what to look for
PrinterName = "Name of the printer you want"
' Set the new default
For Each pPrinter In Printers
If pPrinter.DeviceName = PrinterName Then
Set Printer = pPrinter
End If
Next
' Restore the old default
set Printer = pDefault
Thanks, but I need to set the system default printer.Quote:
Originally posted by HDR:
You could try the following:
dim pDefault as Printer
dim pPrinter as printer
dim PrinterName as string
' Save the original default
set pDefault = Printer
' Tell it what to look for
PrinterName = "Name of the printer you want"
' Set the new default
For Each pPrinter In Printers
If pPrinter.DeviceName = PrinterName Then
Set Printer = pPrinter
End If
Next
' Restore the old default
set Printer = pDefault
With your code I set the default printer for my application. :-)
Thanks anyway
If you know any way to help me thanks