Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select printer when printing from Browser control
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01571742
Message ID:
01571756
Vues:
37
>>>>How do I Select printer when printing from Browser control. I am using this code to print from the browser:
* Code from Microsoft:  http://support.microsoft.com/kb/265126
>>>> #DEFINE OLECMDID_PRINT 6
>>>> #DEFINE OLECMDEXECOPT_PROMPTUSER 1
>>>> #DEFINE OLECMDEXECOPT_DONTPROMPTUSER 2
>>>> ThisForm.oBrowser.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, 0, 0)
>>>>However it only prints to the default printer. The VFP SET PRINTER command has no effect.
>>>>
>>>>As I see it I have two options. Find how to change the printer for this application or find out how to put the entire contents of the ole browser control in a report. At this point I will take either option. The contents of the browser are in a local HTML file so I can easily put it in a report if needed. I'm just not sure how to do that.
>>>
>>>Why you don't want to prompt user? Would not it allow to select printer?
>>>
>>>http://www.bigresource.com/VB-Printing-from-Webbrowser-control-using-ExecWB-cPl3jGcM76.html
>>
>>Setting the default printer in VFP has no effect on printing from the browser. However, thanks to the link above I found some interesting commands and then tried changing one command and BINGO it workeds as I have it below. Note that this command is not modal so you cannot put it in the same code as the print command. (above) Otherwise the printer select dialog is up while the job is already printing.
>>
>>
Thisform.oBrowser.ExecWB(6,1)
>>
>> Thanks
>
>No, my question was - you have two constants defined - one allows to prompt and the other doesn't. The logical choice for your case is to use the one which allows to prompt.
>And this is what your code is doing now, BTW.

OK miss sharp eyes. You got me this time. I just copied and pasted from the MS web site and never really looked at the block of code till just now. As the wise man said "You look but you do not see." The answer was right in front of me the whole time.

Many thanks Naomi.
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform