Results 1 to 2 of 2

Thread: [RESOLVED] WebBrowser1.Document.Write(object)

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2008
    Posts
    267

    Resolved [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

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2008
    Posts
    267

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width