Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Default Printer
Message
 
 
À
12/07/2009 17:45:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01411745
Message ID:
01411760
Vues:
24
>>>Hi All:
>>>
>>>How can I retrieve the default printer so that I can do something like this:
>>>
>>>
>>>* Print a report
>>>do Printreport
>>>* Print a receipt on the receipt printer
>>>lcOldPrinter = defaultprinter()
>>>set printer to name 'Star TSP643 Raster Printer'
>>>do PrintReceipt
>>>* Restore reguler printer
>>>set printer to name &lcOldPrinter
>>>
>>>
>>>Thanks,
>>>
>>>Yossi
>>
>>Yossi,
>>
>>Do you mean
>>
>>Default Windows Printer ?
>
>I looked further in the article you provided and found that
>
>
>SET("PRINTER", 2)
>
>
>seems to be what I'm looking for.
>
>So why do I need all that fancy API code and why is it not enough to say
>
>
>* Print a report
>do Printreport
>* Print a receipt on the receipt printer
>lcOldPrinter = SET("PRINTER", 2)
>set printer to name 'Star TSP643 Raster Printer'
>do PrintReceipt
>* Restore regular printer
>set printer to name &lcOldPrinter
>
>
>Especially since the help defines the SET("PRINTER", 2) as the 'Default Windows printer name'?!

Yes, I was thinking you can just use SET("printer",2). It was not clear what you're after in your original question.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform