areas Property

Microsoft FrontPage Visual Basic

areas Property

Returns an IHTMLAreasCollection object that represents the collection of area settings in an FPHTMLMapElement object or an IHTMLMapElement object.

expression.areas

expression    Required. An expression that returns an FPHTMLMapElement object or an IHTMLMapElement object.

Remarks

Use the Add method to add or remove FPHTMLAreaElement objects to or from the IHTMLAreasCollection object. Use the Item method or id property to reference an IHTMLAreaElement object.

Example

The following example returns a String array containing the values of the href property, which is equivalent to a hyperlink, for all the FPHTMLAreaElement objects in the specified FPHTMLMapElement object.

    Function GetAreaHREF(objMap As FPHTMLMapElement) As String()
    Dim objArea As FPHTMLAreaElement
    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 following example to call the preceding function. This example assumes that there is at least one MAP element in the specified document.

    Sub CallGetAreaHREF()
    Dim objMap As FPHTMLMapElement
    Dim strHREFs() As String
    Dim intCount

    Set objMap = ActiveDocument.all.tags("map").Item(0)
    
    strHREFs = GetAreaHREF(objMap)

    For intCount = 0 To UBound(strHREFs)
        MsgBox strHREFs(intCount)
    Next
End Sub