Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting default tprinter
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00423419
Message ID:
00423431
Views:
19
>How can I set the Windows default printer from within Visual Foxpro.
>How can I retrieve the name of the current windows default printer from within Visual Foxpro.

Last question first: SET('PRINTER', 2) returns the current default printer. You can get a list of all installed printers by using the APRINTERS() function.

There are several ways to set the default printer. One involves re-writing the WIN.INI [ Windows ] section DEFAULT= entry, then having all top-level applications re-load the section.

Another is to re-write the Default registry entry under HKEY_CURRENT_CONFIG\System\CurrentControlSet\Print\Printers.

Easiest is to use the WScript.Network object's SetDefaultPrinter method. The WScript.Network object is part of the Windows Script Host and may not be available on certain platforms.
George

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

Click here to load this message in the networking platform