Set a default Printer

Share this post
FaceBook  Twitter  Mixx.mn     

To Set  a default printer , use following code:-

1) Create a Network Connection

2) Add a printer

3) Set added printer as default printer


'Ex: Call DefaultPrinter("\\ieleServer50\LASER_RIGHT")
'==============================================

Function DefaultPrinter(PrinterPath)

'1) Create a Network Connection
    Set WshNetwork =CreateObject("WScript.Network")

'2) Add a printer
    WshNetwork.AddWindowsPrinterConnection PrinterPath

'3) Set added printer as default printer
    WshNetwork.SetDefaultPrinter PrinterPath
End Function