Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing via ShellExecute to a different Printer
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00646207
Message ID:
00647300
Views:
16
>>From VFP, I want to Print 3 PDF files in succession to a printer which is not the currently set default printer.
>>Notes:
>>ShellExecute appears to only print to the default printer.
>>Using ShellExecute, if I reset the default Printer and Print the 3 files, then when I restore the default printer to the original printer name, before the printer has not completed it's 3 jobs then I find that the last copies go to the wrong printer.
>>Using the SET PRINTER TO command has no effect when Printing via Shell Execute
>
>Not necessarily. It will if a registry entry doesn't exist for the Print verb. Check your registry for the following key:
>HKEY_CLASSES_ROOT\.PDF\Shell\Print\Command
>
>It should have a reference to the Acrobat printer.

It's not necessarily that hive - using Acrobat 5.0 and up, the hive of interest is HKCR\AcroExch.Document; and even better, there's a PrintTo verb supported, which allows you to specify the print device du jour as a part of the ShellExecute(). Take a look at HKCR\AcroExch.Document\shell\printto\command, which takes a number of optional parameters that will either trigger a Printer Select dialog, or will name a printer to use by its local moniker.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform