Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing the default Windows printer from VFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00485503
Message ID:
00485543
Vues:
7
>I have an Eltron Orion label printer attached to pcA. It is shared on a TCP/IP network.
>
>pcB attempts to print on this printer (pcB default printer is a Laser) using the following code:-
>
>SET PRINTER TO NAME GETPRINTER() - operator selects Eltron on pcA
>SET PRINTER ON PROMPT - operator changes orientation to portrait
>
>BUT - unless the Eltron is set up as pcB's default printer I get 'error accessing printer spooler'
>
>If I could just change pcB'c default printer!!!
>
Colin,

There are a couple of ways to do this. First, and easiest, would be to use the Windows Script Host's Network object's SetDefaultPrinter method. Ed Rauh and I wrote about this object in the Dec. 2000 issue of the VFUG newsletter (www.vfug.org). It's the fourth article in a five part series that will answer most questions you might have.

The other way (and I don't know if this applies to Win2K or not) would be to change the setting of the Device entry of the Windows section of Win.ini, then broadcast the message to re-load the section to all top-level windows. My INI Files Class takes care of this automatically. You might want to have a look at the file. Just click the click to go to the page to download it.
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