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:
Private Sub net_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp = net.Application) Then
work.Text = net.Document.documentelement.innerHTML
End If
Call yell
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
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.
Re: Web Browser - Strange DocumentComplete behaviour
I'm almost 90% sure that DocumentElement is an element.
Same problem when using the body tag.
Jord
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. :D
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
Re: Web Browser - Strange DocumentComplete behaviour
Quote:
Originally Posted by iPrank
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