Results 1 to 2 of 2

Thread: RESOLVED: MSHTML - trying to get element collection

Threaded View

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Resolved RESOLVED: MSHTML - trying to get element collection

    I am working on a project where I need to grab all elements of an HTML form via code. I am using a reference to MSHTML and the webbrowser control

    I can get the document object fine, and get the form as well. The problem is when I try to get the elements of the form.

    MSHTML is kind of weird because its from COM and was ported over to .NET by MS. It has TONS of interfaces and classes in it (so many my intellisense slows down when im using it)

    Many of the interfaces and classes point to the same objects though.

    I grab the form and put it in a MSHTML.HTMLFormElement interface (or the MSHTML.HTMLFormElementClass class, they both reference equal eachother)

    the HTMLFormElement interface has an elements property, which should return the forms elements, but instead it just is a reference back to the form itself...

    The only way I am able to grab elements currently is by using
    HTMLFormElement.Item("elementname")
    but since I wont know the element names, I need to get the collection of them, and output their name/value pairs

    I don't think many people have worked with these objects on here.. but im sort of at a stand still.. so I figured I would post
    Last edited by kleinma; Jun 24th, 2005 at 02:02 PM.

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