Skip to main content

NoteCollection.Insert(DocumentPosition, String) Method

Inserts a new note into the specific document position with a custom mark.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation

Declaration

Note Insert(
    DocumentPosition position,
    string customMark
)

Parameters

Name Type Description
position DocumentPosition

A document position to insert a reference into.

customMark String

A format string for the symbol used to mark the reference.

Returns

Type Description
Note

A note (footnote or endnote).

Remarks

A custom reference mark representation depends on the font applied to the reference range.

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

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

//Insert a footnote with a ` custom mark:
DocumentPosition footnoteWithCustomMarkPosition = document.CreatePosition(document.Paragraphs[7].Range.End.ToInt() - 1);
document.Footnotes.Insert(footnoteWithCustomMarkPosition, "\u00BA");

//Insert an endnote with a º custom mark:
DocumentPosition endnoteWithCustomMarkPosition = document.CreatePosition(document.Paragraphs[document.Paragraphs.Count - 2].Range.End.ToInt() - 1);
document.Endnotes.Insert(endnoteWithCustomMarkPosition, "\u0060");

The following code snippets (auto-collected from DevExpress Examples) contain references to the Insert(DocumentPosition, String) 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