[RESOLVED] WebBrowser1.Document.Write(object)
Code:
Dim objMSHTML As New MSHTML.HTMLDocument
Dim objDocument As MSHTML.HTMLDocument
Set objDocument = objMSHTML.createDocumentFromUrl("www.hotmail.com"), vbNullString)
While objDocument.readyState <> "complete"
DoEvents
Wend
WebBrowser1.navigate "about:blank"
WebBrowser1.Document.Write (objDocument)
.Write will shows the following output: [object]. While the object in as MsgBox shows the full HTML in String. How can i make this work. objDocument.toString is not working.
Thank in advanced
Re: [RESOLVED] WebBrowser1.Document.Write(object)
i solved it like this:
Code:
TmpString = "<url>"
Set objDocument2 = objMSHTML.createDocumentFromUrl(TmpString, vbNullString)
While objDocument2.readyState <> "complete"
DoEvents
Wend
HTMLString2 = objDocument2.documentElement.innerHTML
WebBrowser1.Document.Write (HTMLString2)
This works fine .. i now can see the website in WebBrowser1 Control. Only problem now is that website has not the same look as in IE/FireFox. Not all the colors and layout are the same. Is documentElement.innerHTML correct? Looks like not the complete HTML is taken by documentElement.innerHTML. (Tried also Outer)
Is i use WebBrowser1.Navigate(<url>) The website will look the same as in IE/FireFox