RichEditControl.Document Property

Provides access to a Document interface specifying the control’s document.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.XtraRichEdit.v21.1.dll

Declaration

[Browsable(false)]
public Document Document { get; }

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:

View Example

document.LoadDocument("Grimm.docx", DocumentFormat.OpenXml);
DocumentPosition myStart = document.CreatePosition(69);
DocumentRange myRange = document.CreateRange(myStart, 216);
document.Selection = myRange;
See Also