IHTMLAreasCollection

IHTMLAreasCollection


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
add   get_length   get_newEnum  
item   put_length   remove  
tags  

IHTMLAreasCollection::add

HRESULT add(
    IHTMLElement *element, 
    VARIANT before
);

Adds an element to the collection.

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

IHTMLAreasCollection::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 number of elements.

See also put_length

IHTMLAreasCollection::get__newEnum

HRESULT get__newEnum(
    IUnknown **p
);

Retrieves an OLE enumeration interface that can be used to enumerate the areas in this collection.

p
Address of a pointer to a variable of IUnknown type.

IHTMLAreasCollection::item

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.

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.

IHTMLAreasCollection::put_length

HRESULT put_length(
    long v
);

Sets the number of elements in a collection.

v
Long integer value that specifies the number of elements.

See also get_length

IHTMLAreasCollection::remove

HRESULT remove(
    long index
);

Removes an element from the collection.

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

IHTMLAreasCollection::tags

HRESULT tags(
    VARIANT tagName, 
    IDispatch **pdisp
);

Retrieves a collection of all elements in the given collection that have the given HTML tag name.

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.