Method AddHyperlink
AddHyperlink(WordDocument, DocumentSpan, HyperlinkTarget)
Makes the content a span covers a hyperlink.
public static DocumentEdit AddHyperlink(this WordDocument document, DocumentSpan span, HyperlinkTarget target)
Parameters
documentWordDocumentThe document that holds the span.
spanDocumentSpanThe span; it must cover some content.
targetHyperlinkTargetWhere the link goes.
Returns
Exceptions
- ArgumentNullException
documentortargetis null.- ArgumentException
The span is not in
document, covers no content or has an end inside a surrogate pair; or the target names a bookmark the document does not have.- InvalidOperationException
An end is in a shape's text box, or a paragraph's covered content starts and ends in different inline content controls.