Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change windows default printer

Status
Not open for further replies.

andre65

Programmer
Jan 19, 2003
95
NL
Hi all,

I want to change the Windows default printer from VFP60.
What is an easy way of doing this?

I know that set('printer',2) returns the default printer, but I want to change it.

Gr,
Andre
 
andre65

There are two ways listed in FAQ184-2444. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
andre65,

Simple one:
Add a menu list entry (if to use menu) with "SET PRINTER TO NAME GETPRINTER()" as a command line. OR a command button (in a form) with "SET PRINTER TO NAME GETPRINTER()" on the click event.

Peping
 
Peping

Your solution only changes the VFP default printer, not the Windows default printer as requested.
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks you guys,
I was looking for the solution which Mike describes.

Thanks again.
 
Another way, more simple:

oNet = CREATEOBJECT("WScript.Network")
oNet.SetDefaultPrinter("PrtNameToDefault")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top