RichEditControl.Document Property
Provides access to a Document interface specifying the control’s document.
Namespace: DevExpress.XtraRichEdit
Assembly: DevExpress.XtraRichEdit.v26.1.dll
NuGet Package: DevExpress.Win.RichEdit
Declaration
Property Value
| Type | Description |
|---|---|
| Document | A Document interface specifying a document loaded in the control. |
Remarks
The Document property is the main access point to the RichEdit API.
Note
The Document property gives you access only to the main document body. It means that you cannot access field or bookmark collections located in the header/footer using this property. Call the Section.BeginUpdateHeader - Section.EndUpdateHeader pair to access the Document object related to the header and footer.
Use the Document.Selection property to select a text. The following code snippet illustrates how you can select a range of 69 positions starting from the position 216 in the document:
document.LoadDocument("Grimm.docx", DocumentFormat.Docx);
DocumentPosition myStart = document.CreatePosition(69);
DocumentRange myRange = document.CreateRange(myStart, 216);
document.Selection = myRange;