
This interface is a collection of areas that make up the image map.
Areas can be added or removed from the collection. This collection is indexed first by name, then by ID. If duplicate names are found, a collection of those named items is returned. The resulting collection can only be referenced by ordinal position.
This is a collection of AREA tags.
IHTMLAreasCollection Methods
HRESULT add(
IHTMLElement *element,
VARIANT before
);
Adds an element to the collection.
- Returns S_OK if successful, or an error value otherwise.
- element
- Address of the IHTMLElement interface of the element to add.
- before
- VARIANT structure containing the number specifying the position within the collection to place the element. If no value is given, the method places the element at the end of the collection.
See also IHTMLElement, remove
HRESULT get_length(
long *p
);
Retrieves the number of elements in a collection.
- Returns S_OK if successful, or an error value otherwise.
- p
- Address of a long integer variable that receives the number of elements.
See also put_length
HRESULT get__newEnum(
IUnknown **p
);
Retrieves an OLE enumeration interface that can be used to enumerate the areas in this collection.
- Returns S_OK if successful, or an error value otherwise.
- p
- Address of a pointer to a variable of IUnknown type.
HRESULT item(
VARIANT name,
VARIANT index,
IDispatch **pdisp
);
Retrieves an element or a collection from the given collection. The index parameter determines which action to take.
- Returns S_OK if successful, or an error value otherwise.
- name
- VARIANT structure that contains the number or string 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 contains 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.
- index
- VARIANT structure that contains the number specifying the position of an element to retrieve. This parameter is used when name is a string. The method uses the string to construct a collection of all elements that have a name or id equal to the string, then retrieves from this collection the element at the position specified by index.
- pdisp
- Address of a pointer to an IDispatch interface.
HRESULT put_length(
long v
);
Sets the number of elements in a collection.
- Returns S_OK if successful, or an error value otherwise.
- v
- Long integer value that specifies the number of elements.
See also get_length
HRESULT remove(
long index
);
Removes an element from the collection.
- Returns S_OK if successful, or an error value otherwise.
- index
- Long integer value that specifies the element to remove. The method removes the element at the given position in the collection, where 0 is the first position, 1 the second, and so on.
See also add
HRESULT tags(
VARIANT tagName,
IDispatch **pdisp
);
Retrieves a collection of all elements in the given collection that have the given HTML tag name.
- Returns S_OK if successful, or an error value otherwise.
- tagName
- VARIANT structure containing the name of elements to retrieve.
- pdisp
- Address of a pointer to an IDispatch interface.
This method returns an empty collection if no elements having the given name are found. Use the length property on the collection to determine the number of elements it contains.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.