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+

NoteCollection Interface

A collection of Note objects.

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

public interface NoteCollection :
    ReadOnlyNoteCollection,
    ISimpleCollection<Note>,
    IEnumerable<Note>,
    IEnumerable,
    ICollection
Public Interface NoteCollection
    Inherits ReadOnlyNoteCollection,
             ISimpleCollection(Of Note),
             IEnumerable(Of Note),
             IEnumerable,
             ICollection

Remarks

The NoteCollection represents the collection of footnotes and endnotes.

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 a footnote or endnote. You can check whether the note has a custom mark (Note.IsCustom), and access a range related to the reference mark (Note.Range). Call the Note.BeginUpdate and Note.EndUpdate paired methods to open and close the note's content for update.

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

using (RichEditDocumentServer wordProcessor = new RichEditDocumentServer())
{
    wordProcessor.LoadDocument("Document.docx");
    Document document = wordProcessor.Document;
    DocumentPosition footnotePosition = 
    document.CreatePosition(document.Paragraphs[5].Range.End.ToInt() - 1);
    Note footnote = document.Footnotes.Insert(footnotePosition);
    SubDocument footnoteContent = footnote.BeginUpdate();
    footnoteContent.AppendText("This is a test footnote");
    footnote.EndUpdate(footnoteContent);
}

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

The code sample below shows how to change the footnote separator:

RichEditDocumentServer wordProcessor = new RichEditDocumentServer();
wordProcessor.LoadDocument("Documents//Grimm.docx");
Document document = wordProcessor.Document;
if (document.Footnotes.HasSeparator(NoteSeparatorType.Separator))
{
    SubDocument noteSeparator = document.Footnotes.BeginUpdateSeparator(NoteSeparatorType.Separator);
    noteSeparator.Delete(noteSeparator.Range);
    noteSeparator.AppendText("***");
    document.Footnotes.EndUpdateSeparator(noteSeparator);
}
See Also