Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE programming 1

Status
Not open for further replies.
Jul 29, 2005
136
PT
Hi,

Can someone tell me if it´s possible to open an html page in the browser and print it, programmatically?

thank you
 
<a href="javascript:window.print()">Print Page</a> will bring up the printer dialogue box
 
Hi,

Thanks for your post, however, I dont´want to view the print dialog. I don´t even want to change the script in the page. I just want to automate IE. Is this possible?

Thank you
 
Look into the controls Navigate and Navigate2 functions to open the page, and the ExecWB function to print. I don't remember now, but it should be close to WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER or WebBrowser1.ExecWB OLECMDID_PRINT2, OLECMDEXECOPT_DONTPROMPTUSER to print without asking the user - just play with the arguments.
-Max
 
Thankx shakespeare5677

Do you know if there is some way of setting the active printer?

Thank you
 
Sorry, not off the top of my head. You'd have to use the printer object I think. Try doing a search in the forum, I'm sure you'll find stuff. Good luck.
-Max
 
A quick search brings up thread222-1017932 for a simple way of doing it

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top