IHTMLStyleSheetsCollection

IHTMLStyleSheetsCollection


This interface provides the abilities to obtain the number of styleSheets in the collection, and to iterate through the styleSheets collection of the STYLE element.

A zero-based collection of style sheets is exposed from the document object. Each style sheet object represents an individual style sheet that is defined for the document. This object represents instances of the LINK and STYLE elements with a relationship (rel attribute) of STYLESHEET.

Imported style sheets are contained within a STYLE element and are accessible through the IHTMLStyleSheet::get_imports method.

IHTMLStyleSheetsCollection Methods
get_length   get__newEnum   item

IHTMLStyleSheetsCollection::get_length

HRESULT get_length(
    long *p 
);

Retrieves the number of elements in a collection.

p
Address of a long integer variable that receives the length.

This property is read-write on the areas and the options collection for image maps and select boxes, respectively. This allows a developer to shrink the collection.

IHTMLStyleSheetsCollection::get__newEnum

HRESULT get__newEnum(
    IUnknown **p 
);

Retrieves an enumerator interface which can be used to iterate through the styleSheets collection of the STYLE element.

p
Address of a pointer to an IUnknown interface.

IHTMLStyleSheetsCollection::item

HRESULT item( 
    VARIANT *pvarIndex,
    VARIANT *pvarResult 
);

Retrieves an styleSheet element or a collection of styleSheets. The index determines which action to take.

pvarIndex
Address of a VARIANT structure specifying the element or collection to retrieve. If this parameter is a number, the method returns the element in the collection at the given position, where the first element has value 0, the second has 1, and so on. If this parameter is a string, the method returns a collection of elements, where the value of the name or id property for each element is equal to the string.
pvarResult
Address of a VARIANT structure that receives an element object or a collection of element objects if successful, or NULL otherwise.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.