mshtml.IHTMLDocument2 doc = ticketPrint.Document as mshtml.IHTMLDocument2;
gives the error:
Error 1 Cannot convert type 'System.Windows.Forms.HtmlDocument' to 'mshtml.IHTMLDocument2' via a built-in conversion
I did add the reference to the Microsoft.mshtml from the interop's dlls in c:\program files\microsoft.net\ -- was this not the correct DLL or am I missing something?
I'm using C# if anyone's wondering but this is what I have from reading various other attempts at it:
<?IMPORT NAMESPACE="IE" IMPLEMENTATION="#default">
This is the layout of the HTML page (it contains these new additions to the structure). Now, inside my C# code I have:
mshtml.IHTMLDocument2 doc = ticketPrint.Document.DomDocument as mshtml.IHTMLDocument2;
doc.execCommand("print", true, 0);
However, this doesn't work, and I'm assuming it has something to do with the 0. Is there any other way I can specify the landscape directly into the place of 0?