Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
>I'm creating an app where existing PDF files will print based on sales data. The PDF files are already created and sitting in a folder on the network. I'm using ShellExecute to print the PDFs, and need them to print to a specific printer which isn't likely to be the user's default printer.
>
>I found the code to change the default printer using WMI (Thanks Sergey!) but the problem is that ShellExecute doesn't recognize that change and still sends the PDF to the original default printer. I tried creating a separate EXE that gets called from the first program that changes the default printer but that didn't work either (throwing darts at this point).
>
>Any suggestions?
>
>Thanks,
>Larry
See if these approaches work for you:
* Set default printer
oWSHNet = CREATEOBJECT('Wscript.Network')
oWSHNet.SetDefaultPrinter('WindowsPrinterName')
*or
DECLARE Integer SetDefaultPrinter IN WINSPOOL.DRV String
IF SetDefaultPrinter('WindowsPrinterName') = 0
messagebox("Cannot change default Windows Printer to ")
ENDIF
....
Good Luck
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement