G
Guest
Hello there,
I am quite new to .NET development so please forgive my question if it is
trivial. I am trying to print a IHTMLDocument2 object in c# without spawning
a dialog box, because the printing must be Automated.
I have got some code to work that does it with a dialog box, but this is not
what I need. Anyway, here is a snippet of the code I have already written:
Thanks in advance...
PS I am using Visual Studio .NET 2003
I am quite new to .NET development so please forgive my question if it is
trivial. I am trying to print a IHTMLDocument2 object in c# without spawning
a dialog box, because the printing must be Automated.
I have got some code to work that does it with a dialog box, but this is not
what I need. Anyway, here is a snippet of the code I have already written:
Code:
//Navigate to about:blank to initialise the IHTMLDocument2
object empty = System.Reflection.Missing.Value;
axWebBrowser1.Navigate(address_, ref empty, ref empty, ref empty, ref empty);
//stream the html code
mshtml.IHTMLDocument2 doc = axWebBrowser1.Document as mshtml.IHTMLDocument2;
doc.clear();
doc.writeln( .... some html ....);
doc.close();
//print the html
doc.execCommand("print", true, 0 ); //this shows a dialog. i.e. not what I
need
Thanks in advance...
PS I am using Visual Studio .NET 2003