Table of Contents

Method AppendHyperlink

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

Appends a hyperlink to an external target: a start marker, one text run and an end marker, plus the external package relationship the target needs.

public static HyperlinkStart AppendHyperlink(this Paragraph paragraph, string text, string target, CharacterFormat? format = null, string? tooltip = null)

Parameters

paragraph Paragraph

The paragraph. It must belong to a document, because the relationship is document-level state.

text string

The link text.

target string

The target URI.

format CharacterFormat

The run formatting of the link text, or null. Applying the "Hyperlink" character style is the caller's choice, not an implied default.

tooltip string

The tooltip text, or null.

Returns

HyperlinkStart

The appended hyperlink start marker.

Exceptions

ArgumentNullException

A required argument is null.

InvalidOperationException

The paragraph is not attached to a document.