Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Change the Windows
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00531534
Message ID:
00531539
Views:
12
>Friends:
>
>How do you change the Windows default printer from inside VFP?
>
>I am running a process that prints to the Windows default printer. I want to change the default printer within VFP, and after the process completes, reset the Windows default printer back to what it was.
>
>TIA

Gary,

While you can use modify the Win.ini file to change the default printer in Win9x, I'm not certain that it'll work under later versions. Therefore, I'd recommend the Windows Script Host's Network Object, like so
oNet = CREATEOBJECT("WScript.Network")
oNet.SetDefaultPrinter(< printer name >)
and, yes, it works with local printers.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform