I am trying to iterate through the elements of a HTML
document loaded in a WebControl on a WinForm. I have
found many exemples and most of them are like the
following piece of code. Unfortunally this only catch the
tags HTML, STYLE, SCRIPT, HEAD and TITLE. I need to get
all the elements on the page specially the INPUT tags.
What am I missing?

Dim htDoc As mshtml.HTMLDocument
Dim oTags As Object
htDoc = webBrowserControl.Document
For Each oTags In htDoc.All
MsgBox(oTags.tagName)
Next
htDoc = Nothing

WebControl problem. by rc

rc
Thu Jul 31 12:17:11 CDT 2003

Figured i would answer myself. This code was in
NavigateCompleted instead of DocumentCompleted...

>-----Original Message-----
>I am trying to iterate through the elements of a HTML
>document loaded in a WebControl on a WinForm. I have
>found many exemples and most of them are like the
>following piece of code. Unfortunally this only catch
the
>tags HTML, STYLE, SCRIPT, HEAD and TITLE. I need to get
>all the elements on the page specially the INPUT tags.
>What am I missing?
>
> Dim htDoc As mshtml.HTMLDocument
> Dim oTags As Object
> htDoc = webBrowserControl.Document
> For Each oTags In htDoc.All
> MsgBox(oTags.tagName)
> Next
> htDoc = Nothing
>
>.
>

Re: WebControl problem. by Nate

Nate
Thu Jul 31 14:49:09 CDT 2003

I had the same problem, but for what I ended-up using actually worked for
me.
I used the webbrowser.body.innerhtml property instead. That gave me the
entire html of the web-page. I too tried finding examples and found the same
ones you did, they didn't work for me either - but the method I described
works, but does then require you to parse out the text unfortunately.

Nate

"rc" <rcouture@mail.com> wrote in message
news:0d1a01c35761$e4773e10$a301280a@phx.gbl...
> I am trying to iterate through the elements of a HTML
> document loaded in a WebControl on a WinForm. I have
> found many exemples and most of them are like the
> following piece of code. Unfortunally this only catch the
> tags HTML, STYLE, SCRIPT, HEAD and TITLE. I need to get
> all the elements on the page specially the INPUT tags.
> What am I missing?
>
> Dim htDoc As mshtml.HTMLDocument
> Dim oTags As Object
> htDoc = webBrowserControl.Document
> For Each oTags In htDoc.All
> MsgBox(oTags.tagName)
> Next
> htDoc = Nothing
>