>Hi,
>
>I use ShellExcute() win API function to print an image file from VFP. Now, user wanted me to send the output to a different paper try. I realized that "Set Printer to Name XXXX" no longer works since SellExcute() always send to the Default printer, no matter what.
>
>Is there a way to change my default printer from VFP?
You can use the Windows Script Host's Wscript.Network SetDefaultPrinter method to do this; there's extensive coverage of this in the 5 part article on the Windows Script Host written by George Tasker and myself back in the late summer and fall of 2001, posted on
www.vfug.org - see George's sig block for a reference if you can't find it in their back articles. It's also discussed, albeit from a VB/C++ perspect, in a number of the links in my sig block; the VFP code is extremely similar to the VB code, so you shouldn't have any problems. A sample would be:
oWSHNet - CREATEOBJECT('Wscript.Network')
oWSHNet.SetDefaultPrinter('MyWindowsPrinterName')
>
>Thanks,
>
>~Sheldon