Create a table and use callback event
Applies to
IWPTextCursor
Declaration
procedure AddTable(const TableName: WideString; ColCount: Integer; RowCount: Integer; Border: WordBool; EventParam: Integer; CreateHeader: WordBool; CreateFooter: WordBool);
Description
This method creates a table and triggers the callback OnCreateNewCell for each created cell if EventParam was passed with a value != 0. So you can add the data and properties is a very efficient way.
Since the cursor will be placed inside the first cell, you can, in case it is not possible to use the event, fill text in each new cell by moving the cursor through the table using CPMoveNextCell and CPMoveNextRow. To create text after the table use InputParagraph(2,"") !
Name
|
An optional name for the table. You can use MoveToTable to later locate the table.
|
ColCount
|
The count of columns which should be created
|
RowCount
|
The count of rows which should be created (not including header/footer rows). You can abort the creation in event OnCreateNewCell by changing the value of the boolen variable AbortAtRowEnd.
|
Border
|
Create a broder around cells. You can also set border attributes in event OnCreateNewCell.
|
EventParam
|
Parameter passed through to OnCreateNewCell. This event is not called if this parameter is 0.
|
CreateHeader
|
If true an extra header row with rownr=-1 will be created. The formatting routine is able to repeat header rows at the start of a page.
|
CreateFooter
|
If true an extra footer row with rownr=-2 will be created. The formatting routine is able to repeat footer rows at the start of a page. (This special feature is not supported by MSWord)
|
Category
Callback Functions
Table Support
|