TXTextControl.Save Method

Saves data in a file with a specified format.

Syntax

TXTextControl.Save FileName[, Offset[, Format[, CurSelection]]]
Parameter Description
FileName

Specifies the file to save in.

Offset

Optional. Specifies the file position to where the data is to be written when the data of more than one Text Control are to be saved. When not specified or set to -1 the data is appended.

Format

Optional. Specifies a format identifier. When this parameter is not specified the data is saved in the internal Text Control format (3). Otherwise it can be one of the following values:


Constant Description
1 - ANSI text Text in Windows ANSI format (an end of a paragraph is marked with the control characters 13 and 10).
2 - TX text Text in ANSI format (an end of a paragraph is marked only with the control character 10).
3 - TX Text including formatting attributes in the internal Text Control format. Text is stored in ANSI.
4 - HTML HTML format (Hypertext Markup Language).
5 - RTF RTF format (Rich Text Format).
6 - Unicode text Text in Windows Unicode format (an end of a paragraph is marked with the control characters 13 and 10).
7 - TX text Text in Unicode format (an end of a paragraph is marked only with the control character 10).
8 - TX Text including formatting attributes in the internal Text Control format. Text is stored in Unicode.
9 - Microsoft Word 97-2003 Microsoft Word 97-2003 format (*.doc).
10 - XML XML format (Extensible Markup Language).
11 - CSS CSS format (Cascading Style Sheet).
12 - Adobe PDF Adobe Portable Document Format (PDF).
13 - Microsoft Word Microsoft Word format (*.docx).
14 - Adobe PDF/A Adobe Portable Document Format Archive (PDF/A).
CurSelection

Optional. When set to True the current selection is saved. When omitted or set to False or when no selection exists all the control contents are saved. This parameter must be set to False if the saving format is XML (10), CSS (11), AdobePDF (12) or AdobePDF/A (14).

Return Value

The method returns the position in the file behind the saved data. It is zero if the data could not be saved.

Data Types

FileName: String
Offset: Long
Format: Integer
CurSelection: Boolean
Return value: Long

See Also