Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing default printers
Message
De
10/09/1999 00:57:54
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00263195
Message ID:
00263259
Vues:
25
>I have an application that needs to print tickets on a strip printer and print an audit trail on a dot matrix printer. I have the strip printer set as default and would like to print to the audit printer after each input screen. I need to be able to change the printer through programming and not through a dialog box. Does anyone know how this can be done. Any help would be appreciated.

Hi Mac:

Well, if you can 'lock in' the name of each printer as installed on the PC where you are using this, you can save the default printer with:

yyyy = SET('Printer', 3)

then, just 'hard-code' the one you want with:

SET PRINTER TO NAME (xxxxx)

Then set it back when done -- SET PRINTER TO NAME (yyyy).

The only danger is that if someone changes the (ie: RENAME's) the printers installed on that PC, it will 'blow' the above technique. There are some approaches in, I think FAQ and the Files section here on UT that could be used to directly access the registry entries to change the default printer as well, but I personally don't like to hack into it -- its too fragile as it is...

HTH

Rob
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform