NoteCollection.Insert(DocumentPosition) Method
Inserts a new note into the specific document position.
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v20.2.Core.dll
Declaration
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);
See Also
Feedback