Cell object

The Cell object allows you to change the number of cells in a table as well as to format individuals cell.

Retrieving a cell

To retrieve a Cell object from a table, use the Cell method. You need specify the row and column number of the cell.

{Retrieve a cell from the third row and fourth column in a table.}
cell = wordTable.Cell(3,4);

Merging and splitting cells

Use the Merge method to merge two cells.

{Merge two cells.}
wordTable.cell(3,4).Merge(wordTable.cell(3,5));

To split a cell, use the Split method. You can supply the number of rows, the number of columns, or both the number of rows and the number of columns that you would like to create from the cell.

{Split the cell into two rows.}
wordTable.cell(1,2).Split(2);

Adjusting the dimensions of cells

To adjust the dimensions of a cell, use either the SetHeight method or the SetWidth method. Use the SetHeight method to set the height of a cell. You must supply the height of the row in points.

{Set the height of the cell to 24 points.}
wordTable.cell(1,4).SetHeight(24);

Use the SetWidth method to set the width of a cell.

{Set the width the cell to 30 points.}
wordTable.cell(4,5).SetWidth(30);

Fitting text in a cell

Use the FitText property to adjust the width of characters in a cell to the width of the column. Setting the FitText property to true adjusts the width of the characters.

{Fit the text in the column.}
cell.FitText = true;


Documentation Feedback