Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Windows Default Printer
Message
 
À
01/09/2000 14:21:22
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00411791
Message ID:
00411924
Vues:
16
>I installed the WSH. Before I run my code do set('printer',2) to store the default printer. I run my code then the WSH code:
>oWNet=CreateObject("WScript.Network")
>oWNet.SetDefaultPrinter(tv1np).
>The trouble is the name of my default printer is different in my printers window than what the set('printer',2) retreives. So I get an error. What WSH code could I use to retreive the default printer name?

The SetDefaultPrinter() method takes the remote printer name (defined as \\Server\Printer1 for example), not the printer name, which is what SET('PRINTER', 2) returns. APRINTERS() will load an array with this information. The first column being the printer name and the second the port. You could use this function to locate the printer and find the corresponding port. Note that, SET("PRINTER", 2) will return the name in all upper case, while APRINTERS() uses mixed.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform