officefileapi-devexpress-dot-xtrarichedit-dot-beforeexporteventargs-1a81dc7b.md
Provides access to the exporter options.
Namespace : DevExpress.XtraRichEdit
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
public IExporterOptions Options { get; }
Public ReadOnly Property Options As IExporterOptions
| Type | Description |
|---|---|
| IExporterOptions |
An IExporterOptions interface defining export options.
|
The e.Options property can define different objects depending on the export format and the type of exporter. Apart from the IExporterOptions.TargetUri, it specifies different exporter-specific settings.
When exporting to HTML, you can specify several HTML export options, casting the Options value to the HtmlDocumentExporterOptions type. For example, to specify whether the style sheets should be saved in separate css files, or incorporated in the main document, use the HtmlDocumentExporterOptions.CssPropertiesExportType property.
The following code snippet illustrates this:
private void richEditControl_BeforeExport(object sender, DevExpress.XtraRichEdit.BeforeExportEventArgs e) {
DevExpress.XtraRichEdit.Export.HtmlDocumentExporterOptions options = e.Options as DevExpress.XtraRichEdit.Export.HtmlDocumentExporterOptions;
if (options != null)
{
options.CssPropertiesExportType = DevExpress.XtraRichEdit.Export.Html.CssPropertiesExportType.Link;
options.HtmlNumberingListExportFormat = DevExpress.XtraRichEdit.Export.Html.HtmlNumberingListExportFormat.HtmlFormat;
options.TargetUri = Path.GetFileNameWithoutExtension(this.fileName);
}
}
Private Sub richEditControl_BeforeExport(ByVal sender As Object, ByVal e As DevExpress.XtraRichEdit.BeforeExportEventArgs)
Dim options As DevExpress.XtraRichEdit.Export.HtmlDocumentExporterOptions = TryCast(e.Options, DevExpress.XtraRichEdit.Export.HtmlDocumentExporterOptions)
If options IsNot Nothing Then
options.CssPropertiesExportType = DevExpress.XtraRichEdit.Export.Html.CssPropertiesExportType.Link
options.HtmlNumberingListExportFormat = DevExpress.XtraRichEdit.Export.Html.HtmlNumberingListExportFormat.HtmlFormat
options.TargetUri = Path.GetFileNameWithoutExtension(Me.fileName)
End If
End Sub
The following code snippets (auto-collected from DevExpress Examples) contain references to the Options property.
Note
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.
winforms-richedit-save-a-document/CS/SaveDocument/Form1.cs#L51
RtfDocumentExporterOptions options = e.Options as RtfDocumentExporterOptions;
if (options != null)
winforms-richedit-build-a-mail-application/CS/RichEditSendMail/Form1.cs#L95
void OnBeforeExport(object sender, BeforeExportEventArgs e) {
HtmlDocumentExporterOptions options = e.Options as HtmlDocumentExporterOptions;
if (options != null) {
winforms-richedit-export-the-document-into-an-outlook-mail-item/CS/Form1.cs#L71
private void OnBeforeExport(object sender, BeforeExportEventArgs e) {
HtmlDocumentExporterOptions options = e.Options as HtmlDocumentExporterOptions;
if (options != null) {
winforms-richedit-save-text-from-a-range-in-different-formats/CS/GetTextMethodsExample/Form1.cs#L247
{
DevExpress.XtraRichEdit.Export.HtmlDocumentExporterOptions options = e.Options as DevExpress.XtraRichEdit.Export.HtmlDocumentExporterOptions;
if (options != null)
word-document-api-send-mail-merge-document-as-email/CS/RichEditMailMessageExporter.cs#L43
{
HtmlDocumentExporterOptions options = e.Options as HtmlDocumentExporterOptions;
if (options != null)
winforms-richedit-save-a-document/VB/SaveDocument/Form1.vb#L41
"Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
Dim options As RtfDocumentExporterOptions = TryCast(e.Options, RtfDocumentExporterOptions)
If options IsNot Nothing Then
winforms-richedit-build-a-mail-application/VB/RichEditSendMail/Form1.vb#L89
Private Sub OnBeforeExport(ByVal sender As Object, ByVal e As BeforeExportEventArgs)
Dim options As HtmlDocumentExporterOptions = TryCast(e.Options, HtmlDocumentExporterOptions)
If options IsNot Nothing Then
winforms-richedit-export-the-document-into-an-outlook-mail-item/VB/Form1.vb#L70
Private Sub OnBeforeExport(ByVal sender As Object, ByVal e As BeforeExportEventArgs)
Dim options As HtmlDocumentExporterOptions = TryCast(e.Options, HtmlDocumentExporterOptions)
If options IsNot Nothing Then
winforms-richedit-save-text-from-a-range-in-different-formats/VB/GetTextMethodsExample/Form1.vb#L188
Private Sub richEditControl_BeforeExport(ByVal sender As Object, ByVal e As DevExpress.XtraRichEdit.BeforeExportEventArgs)
Dim options As DevExpress.XtraRichEdit.Export.HtmlDocumentExporterOptions = TryCast(e.Options, DevExpress.XtraRichEdit.Export.HtmlDocumentExporterOptions)
If options IsNot Nothing Then
word-document-api-send-mail-merge-document-as-email/VB/RichEditMailMessageExporter.vb#L40
Private Sub OnBeforeExport(ByVal sender As Object, ByVal e As BeforeExportEventArgs)
Dim options As HtmlDocumentExporterOptions = TryCast(e.Options, HtmlDocumentExporterOptions)
If options IsNot Nothing Then
See Also