Home > Source Code > HTML in a WebBrowser control without a file

HTML in a WebBrowser control without a file

HTML in a WebBrowser control without a file

Add this code to a Form1:

Option Explicit

Private Sub Form_Load()
Web1.Navigate “about:blank”
End Sub

Private Sub Web1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim doc As HTMLDocument
Set doc = web1.Document
doc.body.innerHTML = “This is really cool I LOVE THE IE DOM!!”
End Sub

  1. Saravanan K
    March 11, 2009 at 3:03 pm | #1

    It is not working, I get the following error…

    “User-defined” type not defined

    for this

    “Dim doc As HTMLDocument”

    Please Advice…

    Regards,
    Saran
    http://www.thesysteminfo.com

  2. November 25, 2009 at 7:21 am | #2

    Hi,
    I also face the same problem..

    Thanks

  1. No trackbacks yet.