vcl-dxrichedit-dot-documentserver-dot-tdxricheditcustomdocumentserver-30da6217.md
Specifies document content as a byte array (in the Microsoft Word® 97 – 2003 binary format).
property DocBytes: TArray<Byte> read; write;
| Type | Description |
|---|---|
| TArray<T> |
Document content (as a byte array in the DOC format).
|
You can use the DocBytes property to import/export document content in the DOC format (ensure that support for the Microsoft Word® binary format is enabled).
Important
The TdxRichEditDocumentServer component does not work natively with documents in the DOC format. Instead, the component builds a document model in memory using an internal XML-like format. You can edit the current document directly using API members accessible through the Document property.
The DocBytes property value’s read/write operations export/import document content. You can use the following properties to configure DOC export/import settings:
Options.Export.DocProvides access to settings applied to saving the current document to the Microsoft Word® 97 – 2003 binary document (DOC) file.Options.Import.DocProvides access to settings applied to importing Microsoft Word® 97 – 2003 binary documents (DOC files).
Support for the Microsoft Word® binary format is initially disabled for the TdxRichEditDocumentServer component to avoid excessive dependencies.
Note
If support for the target format of an import/export operation is disabled, an exception occurs.
To enable support for the DOC format in your application, expand the Add Unit to Support menu item, and add all required dependencies at design time or in code.
Right-click a TdxRichEditDocumentServer component, check the Word Binary File (DOC) option, and save your project to add all required dependencies automatically.
Add the dxRichEit.Doc unit to the uses clause of the same unit where the TdxRichEditDocumentServer component is placed. If you build the project with runtime packages, add dxRichEditControlDocFormatRS~ to the list of runtime packages.
Add the following directives to the same source files where the TdxRichEditDocumentServer component is placed:
#include "dxRichEdit.Doc.hpp" (to the target HPP file)#pragma link "dxRichEdit.Doc.hpp" (to the corresponding CPP file)You can also use the following API members to import/export document content in different supported[1] formats:
HtmlTextSpecifies document content as a string (in the HTML format).OpenXmlBytesSpecifies document content as a byte array (in the Office OpenXML format).RtfTextSpecifies document content (as an RTF string).TextSpecifies document content (as a plain text string).LoadDocument | LoadDocumentTemplate | SaveDocumentExport/import document content to/from a file or stream in any supported format.
Footnotes
See Also
IdxRichEditDocument.DocBytes Property
Document Print and Import/Export
TdxRichEditCustomDocumentServer Class