printing rich web browser content programatically

  • Thread starter Thread starter larry mckay
  • Start date Start date
L

larry mckay

I'm trying to programatically print the content that is rendered in an
internet explorer control.

if do webbrowser.navigate ("http://www.yahoo.com")
the content of the webpage appears in the browser control.

I'd like to then print the display of the browser control
programatically to a printer.

does anyone have any code samples that can do this?
 
Painfully difficult to do. See this MS article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;315657

I was attempting to create my on web pages and then send them off to a
printer (so I didn't have to create fancy forms, I figured it would be nice
to render HTML tables). I finally gave up. :-( I almost had it working
but was not able to control all the attributes of the printout...like
turning off the headers or telling it to only print certain pages.....
 
* larry mckay said:
I'm trying to programatically print the content that is rendered in an
internet explorer control.

For printing HTML files you can place a hidden WebBrowser control on
your form (customize toolbox and add a reference to the Microsoft
WebBrowser COM component). Then load the file into the control using its
'Navigate' method. This code will print the HTML file:

\\\
wbrResult.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DODEFAULT)
///

If the user souldn't be prompted, use OLECMDEXECOPT_DONTPROMPTUSER.
 
Back
Top