IHTMLDocument2::get_allIHTMLDocument2::get_all*
*Contents  *Index  *Topic Contents
*Previous Topic: IHTMLDocument2
*Next Topic: IHTMLDocument2::get_body

IHTMLDocument2::get_all


HRESULT get_all(
    IHTMLElementCollection **p
);

Retrieves an interface pointer to a zero-based collection of all the elements in an HTML document.

p
Address of a pointer to the IHTMLElementCollection interface of the collection of elements.

The collection includes one element object for each valid HTML tag. If a valid tag has a matching end tag, both tags are represented by the same element object. The collection always includes one element object for each of the HTML, HEAD, and BODY tags regardless of whether the tags are present in the document. If the document contains invalid or unknown tags, the collection includes one element object for each. Unlike valid end tags, unknown end tags are represented by their own element objects. The order of the element objects in the collection is the same as the order of corresponding tags in the document. Although the collection indicates the order of tags, it does not indicate which tags contain others.

You can use the length property to determine the number of element objects in the collection, and the item or tags function to retrieve individual objects or collections of objects from the collection. You can retrieve individual objects by specifying the object's index or by using its name property. Index values can be either numbers or names. Number values are zero-based, that is, 0 for the first element object, 1 for the next, and so on. A name is valid only if it is defined by a name or ID property for at least one of the elements in the collection. If the name is defined by more than one element, you can use it to retrieve a collection of all element objects that define that name.

See also get_body


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.