Charles Law wrote:
> Hi Thomas
> I suspect that this is 'by design'. The WebBrowser control is designed for
> rendering html pages. If the control is not visible then the content is not
> rendered, and if it is not rendered then the data is not available.
> Charles
I use the WebBrowser control in this way with no problems. I use dirty
old Visual Basic, and my WebBrowser control is hidden and I wait until
it's finished loaded and then access the HTMLDocument interface. Here
is the code I use:
If ie.Offline = True Then
pageTimer.Duration = 10000
Else: pageTimer.Duration = 60000
End If
pageTimer.Enabled = True
ie.Visible = False
ie.Navigate strLocation
Do While ie.ReadyState <> READYSTATE_COMPLETE
DoEvents
If pageTimer.TimeRemaining = 0 Then
ie.Stop
Exit Do
End If
Loop
pageTimer.Enabled = False
DoEvents
Set thisIE = ie.Document
DoEvents
Set thisIEWindow = thisIE.parentWindow
DoEvents
'ie' is the webBrowser and 'thisIE' is an HTMLDocument variable.
thisIEWindow is an HTMLWindow variable.
I have included a timer to abort the load if it seems to be in an
infinite loop.
This is quite basic but works well.
Geoff