IHTMLAnchorElement Object

Microsoft FrontPage Visual Basic

IHTMLAnchorElement Object

IHTMLAnchorElement

Represents a bookmark in an HTML document. Bookmarks are represented by A elements that use the name attribute. The IHTMLAnchorElement object provides references to a limited set of properties and methods related to a bookmark in a document. For access to all properties and methods, use the FPHTMLAnchorElement object.

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

Using the IHTMLAnchorElement object

Use the anchors property to return an IHTMLElementCollection object that represents all the bookmarks in a document. Use the Item method to return an IHTMLAnchorElement object that represents a specific bookmark, referenced by ordinal number or by the value of the id attribute. The following example accesses the first bookmark in the active document.

    Dim objBookmark As IHTMLAnchorElement

Set objBookmark = ActiveDocument.anchors.Item(0)