Results 1 to 2 of 2

Thread: problem using wb.document.body.innerhtml

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    problem using wb.document.body.innerhtml

    Hi all. I am trying to load a html code directly in to webbrowser control but i get this error:

    run-time error '91'
    object variable or with block variable not set
    pointing to this line:

    WebBrowser2.Document.body.innerhtml = html1
    could you guys tell me how to fix it.Thanks


    Code:
    Private Sub Command4_Click()
    Dim html1 As String
    
    html1 = "<html>" & _
           "<object classid='clsid:D27CDB6E-AE6D-11cf-44B8-555553540000' id='cameo' width='300' height='250' codebase='http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab' wmode=""transparent"">" & _
            "<param name='movie' value='http://www.somesite.com/viewer300x250.swf' />" & _
            "<param name='quality' value='high' />" & _
            "<param name=""wmode"" value=""transparent"" />" & _
            "<param name='bgcolor' value='#000000' />" & _
            "<param name='FlashVars' value='id=" & Text2.Text & "&audio=off&theme=1' />" & _
            "<param name='allowScriptAccess' value='always'/> <param name='allowNetworking' value='all'/>" & _
            "<embed name='cameo' width='300' height='250' type='application/x-shockwave-flash' pluginspage='http://www.adobe.com/go/getflashplayer'  src='http://www.somesite.com/viewer300x250.swf' quality='high' bgcolor='#000000' FlashVars='id=" & Text2.Text & "&audio=off&theme=1' allowScriptAccess='always' allowNetworking='all' align='middle' play='true' loop='false' quality='high' wmode=""transparent"">" & _
            "</embed>" & _
            "</object>" & _
           "</html>"
           
           WebBrowser2.Document.body.innerhtml = html1
           Text3.Text = html1
           
    End Sub

  2. #2
    Fanatic Member BenJones's Avatar
    Join Date
    Mar 2010
    Location
    Wales UK
    Posts
    814

    Re: problem using wb.document.body.innerhtml

    Have you tryed Navigateing to a blank page first then click the button, try this in form load

    Code:
    Call WebB.Navigate("about:blank")
    I tryed that and I got now errors hope it may help.

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