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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set a default printer in window from our VFP program

Status
Not open for further replies.

binhpham

Programmer
Oct 12, 1999
33
US
Hi all .
Would you kindly show me how to set printer to default printer of Window from a VFP program. Thanks
 
binhpham

There are a few ways to do this, one is a two lines of code (assuming that Windows Scripting v5.6 is installed):
Code:
oNet = CREATEOBJECT("WScript.Network")
oNet.SetDefaultPrinter("\\slp_nt_termserv\Panasonic Printer")
The above works also on local printers

Also look at faq184-2444. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
it depends: if you are printing from a report you may consider this:

modi repo yourreport.frx
- rightclick on the header
- choose Print
- choose your printer
- click print

this will fill the yourreport.frx Memo's with the printerdetails you want

success!

wilfredo
 
Hi
how to set printer to default printer of Window from a VFP program

SET PRINTER TO DEFAULT

:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
Ramani,
I believe Binhpham wants to set the Windows Default printer to a new value within a VFP app, rather than your set VFP's printer to the Window's Default printer which is of course what your code would do. Mike's code would indeed do the first. (I may be wrong, and it wouldn't be the first time!)

Rick
 
Rick
Yes. I am aware of that. The question is ambiguous.

how to set printer to default printer of Window from a VFP program

OR

how to set printer to default printer of Window from a VFP program

The first looks quite simple.. the second looks to me that there is no big need that VFP should change the windows printer options, while technicaly that is possible.

SO i just added in case he is looking for the first option while others pointed the second option. :)

ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
ramani,
Got it - I was confused by your attempt to possibly clear up his confusion! :)

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top