Method RemoveHyperlink
RemoveHyperlink(WordDocument, HyperlinkStart)
Removes a hyperlink, keeping its text: the markers go and the Hyperlink style comes off its runs.
public static DocumentEdit RemoveHyperlink(this WordDocument document, HyperlinkStart link)
Parameters
documentWordDocumentThe document that holds the link.
linkHyperlinkStartThe link's start marker.
Returns
- DocumentEdit
The edit; Before and After are the ends of the text the link held.
Exceptions
- ArgumentNullException
documentorlinkis null.- ArgumentException
The link is not in a paragraph of
document.- InvalidOperationException
The link is in a shape's text box.