shape Property

Microsoft FrontPage Visual Basic

shape Property

Sets or returns a String that represents the shape of a hyperlink in an AREA element within a MAP element.

expression.shape

expression    Required. An expression that returns one of the objects in the Applies To list.

Remarks

The String value of the shape property, which corresponds to the value of the shape attribute, can be one of the following:

circ or circle The shape of the hyperlink is a circle.
poly or polygon The shape of the hyperlink is a polygon.
rect or rectangle The shape of the hyperlink is a rectangle.

Example

The following example replaces the text in the active document with a graphic, and then inserts an image map with one AREA element and specifies its share, coordinates, and hyperlink URL.

    Sub SetImageCoords()
    Dim objImage As FPHTMLImg
    Dim objArea As FPHTMLAreaElement
    
    ActiveDocument.body.innerHTML = _
        "<img src=""graphics/chelan.jpg"" id=""chelan"">" & vbCrLf
    
    Set objImage = ActiveDocument.all.tags("img").Item("chelan")
    objImage.useMap = "#ImageMap"
    
    ActiveDocument.body.insertAdjacentHTML where:="beforeend", _
        HTML:="<map name=""ImageMap"">" & vbCrLf & _
        "<area id=""Area1"">" & vbCrLf & "</map>" & vbCrLf
    Set objArea = ActiveDocument.body.all.tags("area").Item("Area1")
    
    With objArea
        .Shape = "rect"
        .coords = "5, 16, 151, 286"
        .href = "http://www.microsoft.com"
    End With
        
End Sub