Skip to main content

NoteCollection.Insert(DocumentPosition) Method

Inserts a new note into the specific document position.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v24.2.Core.dll

NuGet Package: DevExpress.RichEdit.Core

Declaration

Note Insert(
    DocumentPosition position
)

Parameters

Name Type Description
position DocumentPosition

A document position to insert a reference into.

Returns

Type Description
Note

A note (footnote or endnote).

Remarks

The code sample below shows how to insert a footnote and an endnote:

RichEditDocumentServer wordProcessor = new RichEditDocumentServer();
wordProcessor.LoadDocument("Document.docx");
Document document = wordProcessor.Document;

//Insert a footnote at the end of the 5th paragraph:
DocumentPosition footnotePosition = document.CreatePosition(document.Paragraphs[5].Range.End.ToInt() - 1);
document.Footnotes.Insert(footnotePosition);

//Insert an endnote at the end of the last paragraph:
DocumentPosition endnotePosition = document.CreatePosition(document.Paragraphs[document.Paragraphs.Count - 1].Range.End.ToInt() - 1);
document.Endnotes.Insert(endnotePosition);

The following code snippets (auto-collected from DevExpress Examples) contain references to the Insert(DocumentPosition) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also