PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
New WINDEV, WEBDEV 24 feature!
  • Handling a Table by programming
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Inserts a table in a Document variable.
Example
// Retrieve the document
MyDocument is Document <- WP_Table
// Inserts a 3x3 table at position 1
MyDocument.InsertTable(1, 3, 3)
// Retrieve the document
MyDocument is Document <- WP_Table
// Inserts a table containing 3 columns and 2 rows at cursor position
MyDocument.InsertTable(WP_Table..Cursor, 3, 2)
Syntax

Inserting a table into a a Word Processing document Hide the details

<Result> = <Document>.InsertTable(<Position> [, <Number of columns> [, <Number of rows>]])
<Result>: docFragment variable
Versions 24 and later
docFragment variable with the inserted fragment.
New in version 24
docFragment variable with the inserted fragment.
docFragment variable with the inserted fragment.
<Document>: Document variable
Name of the Document variable to use.
<Position>: Integer
Position where the table will be inserted. This position is expressed in number of characters.
<Number of columns>: Optional integer
Number of columns in the table. This parameters corresponds to 1 by default.
<Number of rows>: Optional integer
Number of rows in the table. This parameters corresponds to 1 by default.
Remarks

Handling a Table by programming

A table in a Word Processing document can be handled by the WLanguage functions for managing arrays.
Some examples:
// Retrieve the document
MyDocument is Document <- WP_ExampleWP
// Inserts a 3x3 table at position 1
MyDocument.InsertTable(1, 3, 3)
// Define a fragment corresponding to the table
f is docFragment(WP_ExampleWP..Value, WP_ExampleWP..Cursor, 0)
let para <- f..Paragraph[1]
IF para..Table = Null THEN
RETURN
END
doc is Document <- WP_ExampleWP..Value
// Adds a row to the table
nSubscript is int = Add(para..Table..Rows)
// Input in cell 2,2
para.Table..Cells[2,2]..Content..Text = "I'm in cell 2,2"
// Deletes row 3
Delete(para..Table..Rows, 3)
// Deletes column 3
Delete(para..Table..Columns, 3)
// Deletes the entire table where the cursor is positioned
Delete(doc..Paragraph, para..ParagraphIndex)
Component : wd240mdl.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment