Table of Contents

Method AddHyperlink

Namespace
DocWright.Dom.Editing
Assembly
DocWright.Dom.dll

Makes the content a span covers a hyperlink.

public static DocumentEdit AddHyperlink(this WordDocument document, DocumentSpan span, HyperlinkTarget target)

Parameters

document WordDocument

The document that holds the span.

span DocumentSpan

The span; it must cover some content.

target HyperlinkTarget

Where the link goes.

Returns

DocumentEdit

The edit; Before and After are the span's ends.

Exceptions

ArgumentNullException

document or target is 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.