Skip to main content

SubDocument.Delete(DocumentRange) Method

Removes content from the specified range.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v23.2.Core.dll

NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation


void Delete(
    DocumentRange range


Name Type Description
range DocumentRange

A range with the content to delete.


Use the Delete method to remove document content (text, images, etc.) located in the specified range.

The code sample below removes specific words from a document:

using DevExpress.XtraRichEdit.API.Native;

using (RichEditDocumentServer wordProcessor = new RichEditDocumentServer())

static void RemoveSpecificWords(Document document)
    string word = "Ounce";
    DocumentRange[] found = document.FindAll
      (word, SearchOptions.WholeWord);
    foreach (DocumentRange range in found)

If the DocumentRange passed as the method parameter contains only table cells without the text surrounding the table, the Delete method clears the only the cells content. If you want do delete a table row or other table elements, utilize the following methods instead:

The following code snippets (auto-collected from DevExpress Examples) contain references to the Delete(DocumentRange) method.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also