Table of Contents

Method InsertNote

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

InsertNote(WordDocument, DocumentPosition, NoteKind, string)

Inserts a footnote or endnote whose mark is a text of the caller's instead of a number (Word's "Custom mark"): the reference (w:customMarkFollows) followed by the mark in the reference style, and the note starting with the mark. Otherwise as InsertNote(WordDocument, DocumentPosition, NoteKind).

public static DocumentEdit InsertNote(this WordDocument document, DocumentPosition at, NoteKind kind, string customMark)

Parameters

document WordDocument

The document.

at DocumentPosition

Where the reference goes.

kind NoteKind

A footnote or an endnote.

customMark string

The mark: 1 to 10 characters (IsValidCustomMark(string?)).

Returns

DocumentEdit

The edit; After is in the note, after the mark and a space.

Exceptions

ArgumentNullException

document is null.

ArgumentException

The position is not in the document, or the mark is not valid.

ArgumentOutOfRangeException

kind is not defined.

InvalidOperationException

The position is in a header, footer, note or text box.