Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Default Printer
Message
 
 
To
12/07/2009 17:45:55
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01411745
Message ID:
01411760
Views:
25
>>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform