Link to home
Start Free TrialLog in
Avatar of qandry
qandry

asked on

PrintTemplateInstantiation as webbrowser trigger

I am connecting to a website that generates data That I wish to collect.
After having fed in the data and performed the necessary calculations a Print button appears.
I succesfully used sendkeys  to select and copy the screen to a file for filtering and saving, which usually works but is not in the least elegant as I have to cancel the print dialog that is autmatically generated and then call on my own procedure.
I've come across an event in webrowser ".PrintTemplateInstantiation" which is definitely triggered after clicking the print button.

The question: How could I use PrintTemplateInstantiation = True to cancel the generation of the print dialog box.

This question is probably worth a lot more than the 80 points I have to spend. If so please advise of same and I shall have to postpone the question untill I can earn my way.
Avatar of qandry
qandry

ASKER

Please note I have posted this question under programming by mistake it had a point value of 80 points. Ive posted it here with a more realistic 200 points.

How can I delete this question from the programming heading ?
My deepest apologies for starting with so much confusion.
Avatar of Richie_Simonetti
Could you post the url?
Regarding second, just ask to community support to delete it or put a comment with a link to this one.
Avatar of qandry

ASKER

Richie the url is www.foodstandards.gov.au/npc/anzfa_npc/
You would need to
1/ search for an ingredient ie 'honey'
2/ select one of the results
3/ nominate a recipe name
4/ click add ingredient
5/ then nominate final weight and serve size.
6/ click calculate
7/ finally PRINT. " it is this that I wish to capture and cancel.
ASKER CERTIFIED SOLUTION
Avatar of Richie_Simonetti
Richie_Simonetti
Flag of Argentina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of qandry

ASKER

Thanks Richie,
I thouht you would have the answer. I had already seen your code for capturing controls on a web page and thought it could work.
What I don.t understand is how
-
Private Function btn_onclick() As Boolean
MsgBox "got it!"
End Function
-
does this manage to interupt the predefined function of the button?
I had hoped to stop at the document produced upon the pressing of the print button but avoid the automated print dialog box appearing, but I can get all the data i need at this current point. Thank you
"...does this manage to interupt the predefined function of the button?..."
Yes, you are switch the "real" event with yours.
It is similar of how to avoid right click on a web page and use your own menu instead of default one.

You could see it at http://www.angelfire.com/realm/vb-shared/IE_WB_DOM_tips.htm

Thanks for "A" grade.