FPHTMLAnchorElement Object

Microsoft FrontPage Visual Basic

FPHTMLAnchorElement Object

FPHTMLAnchorElement Multiple objects

Represents a specified bookmark in a page. Bookmarks are represented by A elements that use the name attribute. See also IHTMLAnchorElement object.

Note    A elements that use the href attribute are links. For information about accessing links, see the FPHTMLLinkElement and IHTMLLinkElement objects.

Using the FPHTMLAnchorElement object

Use the anchors property to return an IHTMLElementCollection object that represents all the anchors in a document. Use the Item method to return an FPHTMLAnchorElement object. The following example returns a String array containing the names of all the bookmarks in the specified document.

Function GetBookmarks(objDoc As FPHTMLDocument) As String()
    Dim strTemp() As String
    Dim intCount As Integer
    
    If objDoc.anchors.Length > 0 Then
        ReDim strTemp(objDoc.anchors.Length - 1)
        
        For intCount = 0 To objDoc.anchors.Length - 1
            strTemp(intCount) = objDoc.anchors.Item(intCount).Name
        Next
        
        GetBookmarks = strTemp
    End If
End Function