Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing Default Printer
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00661824
Message ID:
00661860
Vues:
20
>Hi, how can I set the Default Windows Printer (SET("Printer", 2) from within VFP?

The easiest way is to use the Windows Script Host Wscript.Network object - it has a SetDefaultPrinter method that changes the Windows Default printer assignment:
oWSHNet = CREATEOBJ('Wscript.Network')
oWSHNet.SetDefaultPrinter('SomeWindowsPrinterName')
You can find detailed information on this in VFP in the 5 part article that George Tasker and I did back in the Fall of 2000 for VFUG, available in the back issues section of www.vfug.org, or in many of the links in my sig block below.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform