|
|
|
|
- Handling a Table through programming
<Document variable>.InsertTable (Function) In french: <Variable Document>.InsèreTableau // 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 Word Processing document Hide the details
<Result> = <Document>.InsertTable(<Position> [, <Number of columns> [, <Number of rows>]])
<Result>: docFragment variable docFragment variable with the inserted fragment. <Document>: Document variable Name of the Document variable to be used. <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 through programming A table in a Word Processing document can be handled by the WLanguage functions for managing arrays. For example: // 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 nIndex is int = Add(para.Table.Rows) // Input in cell 2,2 para.Table.Cells[2,2].Content.Text = "I am 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.ParagraphSubscript)
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|