Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ShellExecute & PrintTo
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
01062979
Message ID:
01063005
Views:
21
This message has been marked as the solution to the initial question of the thread.
Probably there are spaces in the Printer name. Try to set the default printer first:

oWSHNet = CREATEOBJECT('Wscript.Network')
oWSHNet.SetDefaultPrinter('WindowsPrinterName')

=ShellExecute(0, "Printto", @lc_file, "", 0,1)

Also:
=ShellExecute(0, "Printto", @lc_file, ["]+SET('PRINTER', 3)+["], 0,1)

Double quotes " only work.



>I'm trying to get ShellExecute to print to a specific. My code is
>
>lc_filt = GETFILE('doc')
> =ShellExecute(0, "Printto", @lc_file, SET('PRINTER', 3), GETENV('TMP'), 5)
>
>
>But depending on the printer that was selected Word returns "Run-time error '1120'. There is a printer error."
>
>Anybody have success with the printto in shellexecute?
Previous
Reply
Map
View

Click here to load this message in the networking platform