PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Use conditions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Creates a Word file (.RTF) from the data found in a Table or TreeView Table control.
Remark: This file can be opened in Word or OpenOffice Writer (depending on the software installed on the current computer).
Example
Reports and Queries
sFile is string
// Asks for the file name
sFile = fSelect("", "", "Choose the export file", ...
"Word files (*.rtf) *.rtf", "rtf", fselCreate + fselExist)
// If the name was not specified, cancels the export
// Otherwise, exports the content of TABLE_TABLE1
IF sFile <> "" THEN TableToWord(TABLE_TABLE1, sFile, taNoTitle)
Syntax
<Result> = <Table control>.ToWord(<Doc file name> [, <Options> [, <Start row> [, <End row>]]])
<Result>: Boolean
  • True if the file was created,
  • False otherwise.
<Table control>: Control name
Name of the control to be used. This control can correspond to:
  • a Table control.
  • a TreeView Table control.
<Doc file name>: Character string
Name and full path of the Word file to create. The file is replaced with the new file if it already exists.
<Options>: Optional Integer constant
Configures the Word file to create.
taColumnDisplayedOrderExports the columns according to the order of columns currently displayed in the control (and not according to the order of columns defined in the editor).
taColumnsTitles
(Default value)
The title of the columns is inserted in the file.
taNoTitleOnly the data is copied to the file.
taNoTotalDoes not export:
  • the rows containing totals, mean and automatic count (these rows are exported by default).
taSelectedLinesExports the selected rows only (all the rows are exported by default).
taWithInvisibleColumnsAlso exports the invisible control columns.
<Start row>: Optional integer
Number of the row where the export will start. If this parameter is not specified, the start row is the first row of the control.
<End row>: Optional integer
Number of the row where the export will end. If this parameter is not specified, the end row is the last row of the control.
Remarks

Use conditions

<Table>.ToWord can be used on:
  • Table or TreeView Table controls based on a data file.
  • Table or TreeView Table controls populated programmatically.
  • single-selection or multi-selection controls.
  • The created file can be opened by Word 95 (or later) or by OpenOffice Writer 2 (or later).
  • The merged columns are ignored.
Business / UI classification: UI Code
Component: wd280std.dll
Minimum version required
  • Version 27
This page is also available for…
Comments
Click [Add] to post a comment