[Table of Contents] [docx version]
WordprocessingML Reference Material - Table of Contents
hyperlink (Hyperlink)
This element specifies the presence of a hyperlink at the current location in the document.
[Example: Consider the following WordprocessingML fragment for a hyperlink:
<w:hyperlink r:id="rId10">
<w:r>
<w:t>Click here</w:t>
</w:r>
</w:hyperlink>
The hyperlink element defines a hyperlink whose display text is Click here, and whose target is specified by the relationship with an Id attribute value of rId10. end example]
Parent Elements |
customXml (§2.5.1.5); fldSimple (§2.16.21); hyperlink (§2.16.24); p (§2.3.1.22); sdtContent (§2.5.2.35); smartTag (§2.5.1.9) |
Child Elements |
Subclause |
bookmarkEnd (Bookmark End) |
§2.13.6.1 |
bookmarkStart (Bookmark Start) |
§2.13.6.2 |
commentRangeEnd (Comment Anchor Range End) |
§2.13.4.3 |
commentRangeStart (Comment Anchor Range Start) |
§2.13.4.4 |
§2.5.1.5 | |
customXmlDelRangeEnd (Custom XML Markup Deletion End) |
§2.13.5.4 |
customXmlDelRangeStart (Custom XML Markup Deletion Start) |
§2.13.5.5 |
customXmlInsRangeEnd (Custom XML Markup Insertion End) |
§2.13.5.6 |
customXmlInsRangeStart (Custom XML Markup Insertion Start) |
§2.13.5.7 |
customXmlMoveFromRangeEnd (Custom XML Markup Move Source End) |
§2.13.5.8 |
customXmlMoveFromRangeStart (Custom XML Markup Move Source Start) |
§2.13.5.9 |
customXmlMoveToRangeEnd (Custom XML Markup Move Destination Location End) |
§2.13.5.10 |
customXmlMoveToRangeStart (Custom XML Markup Move Destination Location Start) |
§2.13.5.11 |
§2.13.5.12 | |
fldSimple (Simple Field) |
§2.16.21 |
hyperlink (Hyperlink) |
§2.16.24 |
§2.13.5.20 | |
§2.13.5.21 | |
moveFromRangeEnd (Move Source Location Container - End) |
§2.13.5.23 |
moveFromRangeStart (Move Source Location Container - Start) |
§2.13.5.24 |
§2.13.5.26 | |
moveToRangeEnd (Move Destination Location Container - End) |
§2.13.5.27 |
moveToRangeStart (Move Destination Location Container - Start) |
§2.13.5.28 |
oMath (Office Math) |
§7.1.2.77 |
oMathPara (Math Paragraph) |
§7.1.2.78 |
permEnd (Range Permission End) |
§2.13.7.1 |
permStart (Range Permission Start) |
§2.13.7.2 |
proofErr (Proofing Error Anchor) |
§2.13.8.1 |
r (Text Run) |
§2.3.2.23 |
sdt (Inline-Level Structured Document Tag) |
§2.5.2.29 |
smartTag (Inline-Level Smart Tag) |
§2.5.1.9 |
subDoc (Anchor for Subdocument Location) |
§2.17.2.1 |
Attributes |
Description | ||||||||||||
anchor (Hyperlink Anchor) |
Specifies the name of a bookmark in the current document which shall be the target of this hyperlink.
If this attribute is omitted, then the default behavior shall be to navigate to the start of the document. If a hyperlink target is also specified using the r:id attribute, then this attribute shall be ignored. If no bookmark exists in the current document with the given bookmark name, then the default behavior shall be to navigate to the start of the document.
[Example: Consider the following WordprocessingML fragment for a hyperlink:
<w:hyperlink w:anchor="chapter3">
The anchor attribute specifies that the target of the current hyperlink shall be the text contained within the bookmark chapter3 within the document. end example]
The possible values for this attribute are defined by the ST_String simple type (§2.18.89). | ||||||||||||
docLocation (Location in Target Document) |
Specifies a location in the target of the hyperlink that has no bookmarks. The method by which the contents of this attribute are linked to document text is outside the scope of this Office Open XML Standard.
If this attribute is omitted, then no location shall be associated with the parent hyperlink. If the anchor attribute is also specified, then this attribute may be ignored when the hyperlink is invoked.
[Example: Consider the following WordprocessingML fragment for a hyperlink:
<w:hyperlink r:id="rId9" w:docLocation="table">
The docLocation attribute specifies that the target of the current hyperlink shall be a region targeted by the string table within the target document. end example]
The possible values for this attribute are defined by the ST_String simple type (§2.18.89). | ||||||||||||
history (Add To Viewed Hyperlinks) |
Specifies whether the target of the parent hyperlink (as specified via the r:id attribute) shall be added to a list of viewed hyperlinks when it is invoked.
If this attribute is omitted, then its value shall be assumed to be false.
[Example: Consider the following WordprocessingML fragment for a hyperlink:
<w:hyperlink r:id="rId9" w:history="true">
The history attribute value of true specifies that the target of the current hyperlink shall be added to a list of visited hyperlinks when invoked within the document. end example]
The possible values for this attribute are defined by the ST_OnOff simple type (§2.18.67). | ||||||||||||
id (Hyperlink Target)
Namespace: .../officeDocument/2006/relationships |
Specifies the ID of the relationship whose target shall be used as the target for this hyperlink.
If this attribute is omitted, then there shall be no external hyperlink target for the current hyperlink - a location in the current document may still be target via the anchor attribute. If this attribute exists, it shall supersede the value in the anchor attribute.
[Example: Consider the following WordprocessingML fragment for a hyperlink:
<w:hyperlink r:id="rId9">
The id attribute value of rId9 specifies that relationship in the associated relationship part item with a corresponding Id attribute value shall be navigated to when this hyperlink is invoked. For example, if the following XML is present in the associated relationship part item:
<Relationships xmlns="…">
The target of this hyperlink would therefore be the target of relationship rId9 - in this case, http://www.contoso.com. end example]
The possible values for this attribute are defined by the ST_RelationshipId simple type (§7.8.2.1). | ||||||||||||
tgtFrame (Hyperlink Target Frame) |
Specifies a frame within the parent HTML frameset for the target of the parent hyperlink when one exists. All values specified by this element shall be handled as follows:
If this attribute is omitted, then no target frame information shall be associated with the parent hyperlink. If the current document is not part of a frameset, then this information may be ignored.
[Example: Consider the following WordprocessingML fragment for a hyperlink:
<w:hyperlink r:id="rId9" w:tgtFrame="_top">
The tgtFrame attribute value of _top specifies that the target of this hyperlink shall be displayed in the full extents of the current window. end example]
The possible values for this attribute are defined by the ST_String simple type (§2.18.89). | ||||||||||||
tooltip (Associated String) |
Specifies a string which may be surfaced in a user interface as associated with the parent hyperlink. The method by which this string is surfaced by an application is outside the scope of this Office Open XML Standard.
If this attribute is omitted, then no associated string shall be linked to the parent hyperlink in the document.
[Example: Consider the following WordprocessingML fragment for a hyperlink:
<w:hyperlink r:id="rId9" w:tooltip="Click here!">
The tooltip attribute value specifies that the parent hyperlink has the associated string of Click here!, which may be used as desired. end example]
The possible values for this attribute are defined by the ST_String simple type (§2.18.89). |
The following XML Schema fragment defines the contents of this element:
<complexType name="CT_Hyperlink">
<group ref="EG_PContent" minOccurs="0" maxOccurs="unbounded"/>
<attribute name="tgtFrame" type="ST_String" use="optional"/>
<attribute name="tooltip" type="ST_String" use="optional"/>
<attribute name="docLocation" type="ST_String" use="optional"/>
<attribute name="history" type="ST_OnOff" use="optional"/>
<attribute name="anchor" type="ST_String" use="optional"/>
<attribute ref="r:id"/>
</complexType>