Wordprocessing Hyperlinks
Links are specified with the <w:hyperlink> element. Links to locations external to the document and links to locations within the document are handled differently based upon the presence or not of the r:id attribute. If the link is to an external target, then the r:id attribute is specified, which is the ID of a relationship stored in the relationship part (document.xml.rels). That relationship has a value of External for the TargetMode attribute. A specific location within the target for the link can be specified with the docLocation attribute. See attributes below.
The r:id="rId4" references the following relationship within the relationships part for the document (document.xml.rels).
An internal link is specified by including the anchor attribute with the value of a bookmark within the document.
Attributes:
The most commonly used attributes are:
Attribute | Description |
---|---|
anchor | Specifies the name of a bookmark within the document. See Bookmark. If the attribute is omitted, then the default behavior is to navigate to the start of the document. If the r:id attribute is specified, then the anchor attribute is ignored. |
docLocation | Specifies a location in the target of the hyperlink, in the case in which the link is an external link. <w:hyperlink r:id="rId9" w:docLocation="table">
<w:r>
<w:t>Click Here</w:t>
</w:r>
</w:hyperlink>
|
history | Specifies whether the target should be added to the list of viewed links. Possible values are true and false. |
id | Specifies the ID of the relationship in the relationships part for an external link. The relationship will contain a Target attribute which is the target of the link. If the id attribute is specified, it supersedes the anchor attribute. |
tgtFrame | Specifies a frame within the HTML frameset for the target when a frameset exists. If no frameset exists, then this attribute is ignored. Possbile values are:
|
tooltip | Specifies a string that can be displayed as associated with the hyperlink in the user interface. |
Related HTML property:
External link
Internal link
<div><a name="myAnchor">Internal Links</a></div>