mshtml type mismatch for document.write

I have the following code (vb.net 2010 express):

        Dim doc As mshtml.HTMLDocument
        axWebBrowser1.Navigate("about:blank")
        doc = CType(axWebBrowser1.Document, mshtml.HTMLDocument)
        doc.close()
        doc.open("about:blank")
        Dim sHTML(0) As String
        sHTML(0) = script(e.Node.Index).branch_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.
DalexanAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

käµfm³d 👽Commented:
You're trying to write an array using a function that expects a string. Why did you create an array? Can you not use:

...

Dim sHTML As String
sHTML = script(e.Node.Index).branch_text
doc.write(sHTML)
...

Open in new window

0
DalexanAuthor Commented:
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.
0
CodeCruiserCommented:
Are you not using the Webbrowser control? You can do

webbrowser1.document.write("<html><body>New Document</body></html>")

http://msdn.microsoft.com/en-us/library/system.windows.forms.htmldocument.write.aspx
0
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

DalexanAuthor Commented:
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.
0
DalexanAuthor Commented:
Additional info...the editor is supposed to be a WYSIWYG editor...
0
CodeCruiserCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DalexanAuthor Commented:
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!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.