Try IHTMLElement. The control doesn't implement the entire DOM that the IE one does so depending on what you are trying to do with Document.body it may not work or you may need to find another way.



Dave Murray Glasgow, UK PGP KeyID: 0x838592B3

Remove NOSPAM from my email address to reply.





Jeff wrote:
I'm trying to replace my usage of the IE control with the Mozilla
ActiveX control in a C# application. I'm getting a type mismatch error
trying to get the Document.body property. The app worked fine with the
IE WebBrowser control.

'...Sub starts here...
IHTMLDocument2 doc = browser.Document; // This was HTMLDocument when I
was using the IE control, now I have to use IHTMLDocument2

return (HTMLBody) doc.body; // <-- This causes an Invalid Cast
exception.

What do I need to cast Document.body to?

And any ideas why my code would work with the IE control but not the
Mozilla control?

Thanks!

_______________________________________________
mozilla-embedding mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-embedding

Reply via email to