Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Default Printer
Message
De
12/07/2009 17:54:41
 
 
À
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:
01411758
Vues:
34
You can, however, you might want to verify that the printer you want to use actually exists first. The link below finds the appropriate printer (in this case a Zebra printer) and sets it as the windows default printer and the foxpro printer, prints something, and then sets both back. Based on what you've written, you can skip setting the windows default printer and only set it in VFP:

Re: Windows won't name printer with machine name on local ma Message #1099435


>>>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'?!
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform