hash Property

Returns a String that represents the bookmark text in the href property that follows the hash (#) mark, including the hash mark.

expression.hash

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

Remarks

An empty String for the hash property indicates that the href attribute for an image does not reference a bookmark.

Although the Object Browser says that the hash property is read/write, if you try to set the hash property, you will receive an error. Use the href property to append a bookmark, as shown in the following example.

Example

The following example appends the bookmark to use to the href attribute for the first hyperlink in the active document if no bookmark is currently referenced.

Dim objLink As FPHTMLAnchorElement

Set objLink = ActiveDocument.Links.Item(0)
If objLink.hash = "" Then
    objLink.href = objLink.href & "#bookmark"
End If

Applies to | FPHTMLAnchorElement Object | FPHTMLAreaElement Object | FPHTMLLocation Object | IHTMLAnchorElement Object | IHTMLAreaElement Object | IHTMLLocation Object