Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set Printer to the Default Printer
Message
From
07/08/1999 15:59:47
 
 
To
06/08/1999 14:41:39
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00250825
Message ID:
00251147
Views:
12
>I am displaying a form asking the user to select a printer with GetPrinter(). I want to set this choice to the system default printer, how can I accomplish this ?

Hi Kenny:

Seems to me that SET('Printer') by itself returns the windows default printer, and SET('Printer,2') or SET('Printer,3') returns the currently selected VFP-6 printer name (as WIndows sees it from the name of the printer icon as installed on the current PC workstation).

You can then invoke SET PRINTER TO NAME (xxxxxx) (do not enclose the actual name in quotes -- but you might need to monkey with enclosing the returned name inside of parantheses if it has any embedded spaces in the name itself) to set the VFP printer to the one you want. Some quick testing from the command window should show you how it works.

Remember, this does not change the Windows default printer, just the one that VFP uses. To change the Windows default printer for all applications you will need to manipulate the registry. I think there is something in FAQ or FILES section on that. Personally, I try to avoid mucking with the registry unless there is an overwhelming need...

HTH

Rob
Previous
Reply
Map
View

Click here to load this message in the networking platform