Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting default tprinter
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00423419
Message ID:
00423431
Vues:
20
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform