AreaElement Object

SharePoint Designer Developer Reference

Represents an AREA element.

Interfaces
This object implements the following interfaces

Remarks

AREA elements are contained within MAP elements in an HTML document. Use the AreaElement object to specify the coordinates and shape of an AREA element as well as other attributes of an AREA element.

Use the areas property of a MapElement object to return the AreasCollection object of a MAP element. Use the item method to return an AreaElement object. The following example returns a string array containing the values of the href property, which is equivalent to a hyperlink, for all the AreaElement objects in the specified MapElement object.

Visual Basic for Applications
Function GetAreaHREF(objMap As MapElement) As String()
    Dim objArea As AreaElement
    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

Use the href, Shape, and coords properties to specify the appearance and behavior of an AREA element. The following example takes arguments that specify the shape, hyperlink behavior, and coordinates of the specified AreaElement object.

Visual Basic for Applications
Sub SetArea(objArea As AreaElement, iX1 As Integer, _
        iY1 As Integer, iX2 As Integer, iY2 As Integer, _
        strHREF As String, strShape As String)
    Dim strCoords As String
    
    strCoords = iX1 & "," & iY1 & "," & iX2 & "," & iY2
    
    With objArea
        .href = strHREF
        .Shape = strShape
        .coords = strCoords
    End With
End Sub

See Also