RichEditControl.Document Property

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

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.XtraRichEdit.v20.1.dll

Declaration

[Browsable(false)]
public Document Document { get; }
<Browsable(False)>
Public ReadOnly Property Document As Document

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.

Check a list of supported document elements and information on how to manage them in code.

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.OpenXml);
DocumentPosition myStart = document.CreatePosition(69);
DocumentRange myRange = document.CreateRange(myStart, 216);
document.Selection = myRange;

Implements

See Also