Table of Contents

Method InsertTable

Namespace
DocWright.Dom.Editing
Assembly
DocWright.Dom.dll

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

document WordDocument

The document that holds the position.

at DocumentPosition

Where to insert.

rows int

The number of rows, at least 1.

columns int

The number of columns, 1 to 63.

Returns

DocumentEdit

The edit; After is the start of the first cell.

Exceptions

ArgumentNullException

document is null.

ArgumentException

The position is not in document, or falls inside a surrogate pair.

ArgumentOutOfRangeException

rows or columns is 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.