Dalexan
asked on
mshtml type mismatch for document.write
I have the following code (vb.net 2010 express):
Dim doc As mshtml.HTMLDocument
axWebBrowser1.Navigate("ab out:blank" )
doc = CType(axWebBrowser1.Docume nt, mshtml.HTMLDocument)
doc.close()
doc.open("about:blank")
Dim sHTML(0) As String
sHTML(0) = script(e.Node.Index).branc h_text
doc.write(sHTML)
sHTML = Nothing
and I'm getting a type mismatch on the doc.write command. I also tried Dim sHTML() as Object = ...branch_text but the same results. The WebBrowser1 object is from the axSHDocVw.dll.
I can't seem to get the right combination of things to get this to work Please Help.
Dim doc As mshtml.HTMLDocument
axWebBrowser1.Navigate("ab
doc = CType(axWebBrowser1.Docume
doc.close()
doc.open("about:blank")
Dim sHTML(0) As String
sHTML(0) = script(e.Node.Index).branc
doc.write(sHTML)
sHTML = Nothing
and I'm getting a type mismatch on the doc.write command. I also tried Dim sHTML() as Object = ...branch_text but the same results. The WebBrowser1 object is from the axSHDocVw.dll.
I can't seem to get the right combination of things to get this to work Please Help.
ASKER
Tried that first...got the mismatch error. doc.write is expecting a "ParamArray psarray() as Object", so I tried the array but still no luck.
Are you not using the Webbrowser control? You can do
webbrowser1.document.write ("<html><b ody>New Document</body></html>")
http://msdn.microsoft.com/en-us/library/system.windows.forms.htmldocument.write.aspx
webbrowser1.document.write
http://msdn.microsoft.com/en-us/library/system.windows.forms.htmldocument.write.aspx
ASKER
Does it allow editing? The display is in an application to allow managers to edit scripts being displayed. The users are running an app that has a WebBrowser control to view the scripts, and a separate window containing the axWebBrowser control is used to allow editing...everything I found online indicated the WebBrowser control couldn't do this.
ASKER
Additional info...the editor is supposed to be a WYSIWYG editor...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is FANTASTIC! Thank you for pointing us in the right direction. Hopefully others searching for a HTML WYSIWYG Editor will be able to find this now.
This includes a stand-alone app and an API to implement...we're using the API and it works great!
This includes a stand-alone app and an API to implement...we're using the API and it works great!
Open in new window