Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Default Printer
Message
From
12/07/2009 16:43:22
 
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:
01411750
Views:
32
>>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 ?

Phew! Maybe I do mean that. What's special about the **Windows** printer.

I wouldn't be having a problem if I knew ahead of time what all the names are. In that case I would say:
* 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 'HP LaserJet 3050 Series PCL 6'
And this would work in my situation.
Previous
Reply
Map
View

Click here to load this message in the networking platform