Home > How-To Library > System & API

How to set the system default printer to Adobe PDF

**************************************************************** * © 2007 CodeItBetter http://www.codeitbetter.com * * This notice MUST stay intact for legal use * ****************************************************************
Public Function SetDefaultPrinterToAdobePDF() 'Need to set the Windows Script Host Object Model (/system32/wshom.ocx) reference for this to function. Dim wshObj As New WshNetwork On Error GoTo SetDefaultPrinterToAdobePDF_Error wshObj.SetDefaultPrinter ("Adobe PDF") Set wshObj = Nothing ExitHere: On Error GoTo 0 Exit Function SetDefaultPrinterToAdobePDF_Error: RaiseEvent ErrRepo("SetDefaultPrinterToAdobePDF", Err.Number, _ "Unable to set default printer to Adobe PDF.", False) Err.Clear Resume Next End Function

If you would like to submit your code here please us. Do not forget to mention your name. We are always thankful to each and everyone of you who submitted their code here.