I'm working on an upgrade to my mail merge newsletter program, and am having a hard time figuring out how to set the entire document HTML using MSHTML in C#.
It seems from my own trials and numerous posts I've read, that the document.outerHTML property is read-only. So in my WYSIWYG html editor, when I try to allow a user to paste in their own HTML (with custom body tags, styles, etc) MSHTML replaces it with a vanilla <html><head></head><body> tag.
Here's a couple of things I'll be trying... has anyone else had success with these approaches? I'll post back later if I'm able to find a solution.
--------------
http://www.vbforums.com/showthread.php?p=2198670#post2198670
1. Make sure the document is loaded. (The DocumentCompleteEvent shows this.)
2. Get the AxWebBrowser.Document object and cast it to mshtml.IHTMLDocument2.
3. Set IHTMLDocument2.body.innerHTML property to the HTML string.
--------------
http://www.csharpfriends.com/Forums/...x?PostID=36601
casting the document to an IHtmlDocument2 object and using the document.write() method.
--------------
__________________
Please login or register to view this content. Registration is FREE - free online training in Java, J2EE, and MySQL.
Please login or register to view this content. Registration is FREE - answers and advice from a geek who knows stuff.
|