IHTMLAreaElement Object

Microsoft FrontPage Visual Basic

IHTMLAreaElement Object

IHTMLAreaElement

Represents an AREA element. AREA elements are contained within MAP elements in an HTML document. Use the IHTMLAreaElement object to specify the coordinates and shape of an AREA element. See also the FPHTMLAreaElement object.

Using the IHTMLAreaElement object

Use the areas property of an IHTMLMapElement or FPHTMLMapElement object to return the IHTMLAreasCollection object of a MAP element. Use the Item method to return an IHTMLAreaElement object. The following example returns a string array containing the values of the href property, which is equivalent to a hyperlink, for all the IHTMLAreaElement objects in the specified FPHTMLMapElement object.

Function GetAreaHREF(objMap As FPHTMLMapElement) As String()
    Dim objArea As IHTMLAreaElement
    Dim strAreas() As String
    Dim intCount As Integer

    ReDim strAreas(objMap.areas.Length - 1)

    For intCount = 0 To objMap.areas.Length - 1
        Set objArea = objMap.areas.Item(intCount)
        strAreas(intCount) = objArea.href
    Next

    GetAreaHREF = strAreas
End Function