I have an access app and I want to change the default printer, print a report to it and then reset the default printer. I can call a vbscript to do it and it works fine. Is is possible to just use vbscript from within VBA?
Here's the code I'm trying to run:
Dim WshNetwork as Object
Set WshNetwork = WScript.CreateObject("WScript.Network"
PrinterPath = "\\PrtServer\Printer10"
WshNetwork.SetDefaultPrinter PrinterPath
It returns an "Object Required" error message. I've played with the references but nothing works.
Can this be done?
Thanks,
mapman04
Here's the code I'm trying to run:
Dim WshNetwork as Object
Set WshNetwork = WScript.CreateObject("WScript.Network"
PrinterPath = "\\PrtServer\Printer10"
WshNetwork.SetDefaultPrinter PrinterPath
It returns an "Object Required" error message. I've played with the references but nothing works.
Can this be done?
Thanks,
mapman04