Skip to main content

TdxRichEditControlBase.LoadDocumentTemplate(string,TdxRichEditDocumentFormat) Method

Loads a document template from the specified file.

Declaration

procedure LoadDocumentTemplate(const AFileName: string; ADocumentFormat: TdxRichEditDocumentFormat); overload;

Parameters

Name Type Description
AFileName string

An absolute or relative path to a source document file.

ADocumentFormat TdxRichEditDocumentFormat

A document format.

Remarks

If the ADocumentFormat parameter accepts the TdxRichEditDocumentFormat.Undefined value, the LoadDocumentTemplate procedure detects the target format by the file name extension. If the file name has no extension, the LoadDocumentTemplate procedure iterates through all supported document formats to find the best possible match in the target file’s content.

A successful LoadDocumentTemplate procedure call raises the OnDocumentLoaded event. The Rich Edit control treats the loaded document as a new one (that is, resets the Options.DocumentSaveOptions.CurrentFileName and Options.DocumentSaveOptions.CurrentFormat properties).

Note

The Rich Edit control has built-in support only for the plain text and RTF document formats to avoid excessive dependencies. Refer to the following topic for information on how to enable the DOC, DOCX, and HTML formats: Rich Edit Control: Document Management.

A LoadDocumentTemplate procedure call cannot import a document if its format is disabled.

See Also