Note Interface
Represents a document note (footnote or endnote).
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v24.2.Core.dll
NuGet Package: DevExpress.RichEdit.Core
#Declaration
#Related API Members
The following members return Note objects:
#Remarks
The NoteCollection contains Note objects. Use the Document.Footnotes property to access the collection of footnotes, and the Document.Endnotes property to access the endnotes collection.
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. The Note.IsCustom property indicates whether the note has a custom reference mark. The Note.Range property provides access to the range occupied by the reference mark.
Use the Note.BeginUpdate() - Note.EndUpdate() methods to access or update the note’s content.
The code sample below shows how to change the endnote’s character properties:
static void EditEndnote(RichEditDocumentServer wordProcessor)
{
wordProcessor.LoadDocument("Documents//Grimm.docx");
Document document = wordProcessor.Document;
//Access the endnote content:
SubDocument endnote = document.Endnotes[0].BeginUpdate();
//Exclude the reference mark and the space after from the range to be edited:
DocumentRange noteTextRange = endnote.CreateRange(endnote.Range.Start.ToInt() + 2, endnote.Range.Length
- 2);
//Access the range's character options:
CharacterProperties characterProperties = endnote.BeginUpdateCharacters(noteTextRange);
//Change the note's color and make it italic:
characterProperties.ForeColor = System.Drawing.Color.Red;
characterProperties.Italic = true;
//Finalize the character formatting update:
endnote.EndUpdateCharacters(characterProperties);
//Finalize the endnote update:
document.Endnotes[0].EndUpdate(endnote);
}