Skip to main content
A newer version of this page is available. .

RichEditControl.BeforeImport Event

Occurs before a document is loaded (imported from an external source).

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.XtraRichEdit.v19.1.dll

Declaration

public event BeforeImportEventHandler BeforeImport

Event Data

The BeforeImport event's data class is BeforeImportEventArgs. The following properties provide information specific to this event:

Property Description
DocumentFormat Gets the format of the document being loaded.
Options Provides access to the importer options.

Remarks

The BeforeImport event enables you to adjust the importer options as required.

Note

A complete code sample project is available at Import from HTML - How to specify encoding and external content location.

The following example illustrates how to use the BeforeImport event to specify the location of the loaded HTML file’s external content:

private void richEditControl2_BeforeImport(object sender, BeforeImportEventArgs e) {
    if(e.DocumentFormat == DocumentFormat.PlainText) {
        ((PlainTextDocumentImporterOptions)e.Options).Encoding = cur_Encoding;
    }
}
See Also