All docs
V20.1
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

Document.Endnotes Property

Provides access to document endnotes.

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

NoteCollection Endnotes { get; }
ReadOnly Property Endnotes As NoteCollection

Property Value

Type Description
NoteCollection

A collection of endnotes.

Remarks

The NoteCollection contains document endnotes - notes that appear at the end of the document. Call the NoteCollection.Insert method to insert a new note into the specific document position. Pass the symbol used to mark the reference to the Insert method to insert a note with a custom mark.

Access a collection item by its index. The Note object represents an endnote. You can check whether the note has a custom mark (Note.IsCustom), and access the range related to the reference mark (Note.Range). Call the Note.BeginUpdate and Note.EndUpdate paired methods to initiate the update session and access the note's content.

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

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

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

    //Access the endnote content
    //And insert text:
    SubDocument endnoteContent = endnote.BeginUpdate();
    endnoteContent.AppendText("First endnote");

    //Finalize the endnote update:
    endnote.EndUpdate(endnoteContent);
}

Use the NoteCollection.HasSeparator method to determine what separators the endnotes have. The NoteSeparatorType enumeration lists available separator types. Use the NoteCollection.BeginUpdateSeparator and NoteCollection.EndUpdateSeparator paired method to initiate an update session and access the separator content.

See Also