Method InsertNote
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
documentWordDocumentThe document.
atDocumentPositionWhere the reference goes.
kindNoteKindA footnote or an endnote.
customMarkstringThe mark: 1 to 10 characters (IsValidCustomMark(string?)).
Returns
- DocumentEdit
The edit; After is in the note, after the mark and a space.
Exceptions
- ArgumentNullException
documentis null.- ArgumentException
The position is not in the document, or the mark is not valid.
- ArgumentOutOfRangeException
kindis not defined.- InvalidOperationException
The position is in a header, footer, note or text box.