Results 1 to 5 of 5

Thread: Web Browser - Strange DocumentComplete behaviour

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2004
    Location
    Manchester
    Posts
    266

    Exclamation Web Browser - Strange DocumentComplete behaviour

    Hello,

    I've come across a problem whilst coding my web browser control. Any help would be very much appreciated. Here's the deal:


    VB Code:
    1. Private Sub net_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    2.     If (pDisp = net.Application) Then
    3.             work.Text = net.Document.documentelement.innerHTML
    4.     End If
    5.     Call yell
    6. End Sub

    Now, before I even navigate to a page. (On form load in fact), my web browser control (net) fires the following error:
    It highlights the work.text line
    Code:
    Rune-time error '91':
    Object variable or With block variable not set
    What is the cause of this problem? Thanks a lot.
    Jord

  2. #2
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Web Browser - Strange DocumentComplete behaviour

    I'm not sure if there is any element in IHTMLDOM called documentelement.
    Change it to:

    net.Document.Body.innerHTML

    and see what happens.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2004
    Location
    Manchester
    Posts
    266

    Re: Web Browser - Strange DocumentComplete behaviour

    I'm almost 90% sure that DocumentElement is an element.
    Same problem when using the body tag.

    Jord

  4. #4
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Web Browser - Strange DocumentComplete behaviour

    Quote Originally Posted by intraman
    I'm almost 90% sure that DocumentElement is an element.
    Sure it is. A Google search helped me. Thanks.
    http://www.google.com/search?client=...utf-8&oe=utf-8

    May be it is foolish...but still...try:
    If (pDisp Is net.Application) Then
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2004
    Location
    Manchester
    Posts
    266

    Re: Web Browser - Strange DocumentComplete behaviour

    Quote Originally Posted by iPrank
    Sure it is. A Google search helped me. Thanks.
    http://www.google.com/search?client=...utf-8&oe=utf-8

    May be it is foolish...but still...try:
    If (pDisp Is net.Application) Then
    Well, thanks again but it hasn't sorted the problem.
    I think it's something a bit deeper than that. I never thought I would be so difficult to retrieve HTML from a web page using the MICROSOFT Internet Control!

    Jord

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