Method InsertTable
InsertTable(WordDocument, DocumentPosition, int, int)
Inserts a table at a position.
public static DocumentEdit InsertTable(this WordDocument document, DocumentPosition at, int rows, int columns)
Parameters
documentWordDocumentThe document that holds the position.
atDocumentPositionWhere to insert.
rowsintThe number of rows, at least 1.
columnsintThe number of columns, 1 to 63.
Returns
- DocumentEdit
The edit; After is the start of the first cell.
Exceptions
- ArgumentNullException
documentis null.- ArgumentException
The position is not in
document, or falls inside a surrogate pair.- ArgumentOutOfRangeException
rowsorcolumnsis out of range.- InvalidOperationException
The position is inside an inline content control or a shape's text box, or its paragraph is not in a block container.