Method MergeCells
MergeCells(WordDocument, TableCell, TableCell)
Merges the rectangle of whole cells whose corners are two cells into one cell.
public static DocumentEdit MergeCells(this WordDocument document, TableCell first, TableCell last)
Parameters
documentWordDocumentThe document that holds the cells.
firstTableCellOne corner.
lastTableCellThe opposite corner, in the same table.
Returns
- DocumentEdit
The edit; After is the start of the merged cell.
Exceptions
- ArgumentNullException
An argument is null.
- ArgumentException
The cells are not in one table of
document, or do not bound a rectangle of whole cells.- InvalidOperationException
A vertical merge crosses the rectangle's top or bottom edge.