You can also try this (if you do not want to switch the windows printer)
SET PRINTER TO DEFAULT
SET PRINTER TO "&value"
Main Topics
Browse All TopicsI have read that VFP 9 has a problem with the Set Print command. I am wondering if anyone has found any other solutions.
The problem is, if you have more than one printer, and you want to print to the one that is not the default printer, in most cases the Set Print command does nothing, and your output goes to the default printer.
I have a report that was written in VFP8 that prints to a receipt printer. After compiling in VFP9, it still works fine. But if I try to modify anything on that report, and then recompile, it will fail to set the printer. I checked the environ field in the first record of the frx file and it is still set to F.
I read one thread on foxite.com about using the WinAPI's to reset the Windows default printer, then print the report, then reset it back. I'd rather not do that, since the only reason I was modifying this report was to speed it up by replacing graphics with text, since VFP9 is significantly slower than VFP8, and I am concerned that resetting Windows will be even slower.
I have also read some people get different responses if they use GetPrinter or Prompt, but I don't want to use either. Has anyone found a better solution?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
jrbbldr, you are correct, I'm not seeing any degradation in performance using Win APIs. I should have realized that is probably the only thing that doesn't get worse with each update from micorsoft.
I guess I'll just have to live with the overall degradation of VFP9. Pardon my whining, I'm just getting more and more disappointed with ms.
Business Accounts
Answer for Membership
by: jrbbldrPosted on 2009-09-04 at 21:09:58ID: 25264912
"I am wondering if anyone has found any other solutions."
ownloads/d etails.asp x? FamilyId =C717D943- 7E4B-4622- 86EB-95A22 B832CAA&di splaylang= en
========== ========== ==== ile = <desired VFP Report Form>
--- Determine if Desired Printer Installed --- ork") ewPrinter)
efaultPrin ter)
========== ========== ====
"I read one thread on foxite.com about using the WinAPI's to reset the Windows default printer, then print the report, then reset it back"
Sure - regardless of your concerns use Windows scripting
http://www.microsoft.com/d
to temporarily change the Windows default printer and then return it to the original after the print job is done.
Something like:
* ==========================
mcFRXF
* --- Determine Existing Default Windows Printer ---
lcDefaultPrinter = SET("PRINTER",2)
* --- Use APRINTERS() To Determine What Printers Available on this Workstation ---
=APRINTERS(gaPrinters)
*
nLoc = ASCAN(gaPrinters,"Image Printer")
IF nLoc > 0
* --- Use Windows Scripting To Set Default Printer To New Image Printer ---
lcNewPrinter = "Image Printer"
ONET = CREATEOBJECT("WScript.Netw
ONET.SetDefaultPrinter(lcN
SET PRINTER TO NAME (lcNewPrinter)
* --- "Print" Report Form To Image Printer ---
SELECT RptFile
REPORT FORM (mcFRXFile) TO PRINTER NOCONSOLE
* --- When Done Printing - Use Windows Scripting To Restore Original Default Printer ---
ONET.SetDefaultPrinter(lcD
RELEASE ONET
SET PRINTER TO NAME (lcDefaultPrinter)
ELSE && IF nLoc > 0
WAIT WINDOW "Image Printer Not Installed" TIMEOUT 4
ENDIF && IF nLoc > 0
* ==========================
Try it out for yourself. It executes fast enough for me and hopefully it will for you too.
Good Luck