AddTable Method

[Top]  [Chapter]  [Previous]  [Next]

Applies to



procedure AddTable(ColCount: Integer; RowCount: Integer; Border: WordBool; EventParam: Integer; CreateHeader: WordBool; CreateFooter: WordBool);


This is a powerful and versatile method. It creates a table inside the merge field inside the mailmerge process. The callback OnCreateNewCell is triggered if EventParam was passed with a value != 0. So you can add the data and properties is a very efficient way.


If you do not need to merge the template again we recommend to use DeleteFields. This makes sure there are no extra empty lines before and after the table which are required to host the field markers.



The count of columns which should be created


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.


Create a broder around cells. You can also set border attributes in event OnCreateNewCell.


Parameter passed through to OnCreateNewCell. This event is not called if this parameter is 0.


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.


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)


Callback Functions

Table Support

[idh_iwpfieldcontents_addtable.htm]    Copyright © 2007 by WPCubed GmbH