Back to Devexpress

IdxRichEditDocument.Text Property

vcl-dxrichedit-dot-nativeapi-dot-idxricheditdocument-afa1f4dd.md

latest5.8 KB
Original Source

IdxRichEditDocument.Text Property

Specifies document content (as a plain text string).

Declaration

delphi
property Text: string read; write;

Property Value

TypeDescription
string

Document content (as a plain text string).

|

Remarks

You can use the Text property to import/export document content in the plain text format (TXT). Unlike all other formats, support for TXT is initially enabled for both TdxRichEditControl and TdxRichEditDocumentServer components.

Internal Document Model and Import/Export Operations

Important

TdxRichEditControl and TdxRichEditDocumentServer components do not work natively with documents in the DOC format. Instead, these components build a document model in memory using an internal XML-like format. You can use the IdxRichEditDocument interface to edit the current document directly.

The Text property value’s read/write operations import/export document content. You can use the following properties to configure plain text import/export settings:

Options.Export.PlainTextProvides access to settings applied to exporting a document to the TXT file format.Options.Import.PlainTextProvides access to settings applied to importing plain text (TXT) documents into the Rich Edit control.

Import/Export Format Support

DevExpress Rich Text components initially support a limited number of document formats to avoid excessive dependencies:

TdxRichEditControlHas predefined support only for TXT and RTF.TdxRichEditDocumentServerHas predefined support only for TXT.

To enable support for all available formats, add all required dependencies at design time or in code:

ExtensionDocument FormatFormat ValueImport/Export SettingsSupport / Required Dependencies
TXT/txtPlain TextPlainTextOptions.Import.PlainText/Options.Export.PlainTextBuilt-in Support
RTF/rtfRich Text FormatRtfOptions.Import.Rtf/Options.Export.RtfdxRichEdit.Rtf (add only for TdxRichEditDocumentServer)
DOC/docMicrosoft Word® 97 – 2003DocOptions.Import.Doc/Options.Export.DocdxRichEdit.Doc
HTML/htmlHypertext Markup LanguageHtmlOptions.Import.Html/Options.Export.HtmldxRichEdit.Html
DOCX/docxOffice OpenXMLOpenXmlOptions.Import.OpenXml/Options.Export.OpenXmldxRichEdit.OpenXML

At design time, you can right-click a TdxRichEditControl or TdxRichEditDocumentServer component, expand the Add Unit to Support menu item, and add all required dependencies.

Other Document Import/Export Options

You can also use the following API members to import/export document content in different supported[1] formats:

DocBytesSpecifies document content as a byte array (in the Microsoft Word® 97 – 2003 binary format).OpenXmlBytesSpecifies document content as a byte array (in the Office OpenXML format).RtfTextSpecifies document content (as an RTF string).LoadDocument | SaveDocumentExport/import document content to/from file or stream in any supported format.

Footnotes

  1. Ensure that support for all required document formats is enabled; otherwise, an exception occurs.
    Refer to corresponding API member descriptions for detailed information on support for different document formats.

See Also

TdxRichEditCustomDocumentServer.Text Property

Document Print and Import/Export

IdxRichEditDocument Interface

IdxRichEditDocument Members

dxRichEdit.NativeApi Unit