Method SetCellBorders
SetCellBorders(WordDocument, DocumentSpan, CellBorderSides, BorderEdge?)
Sets borders on a block of cells as Word's Borders gallery does: the edges asked for get the edge given (or no border when it is null), and a cell outside the block that shares one of those edges gets it too, so the two sides of the edge agree (WQ-0099).
public static DocumentEdit SetCellBorders(this WordDocument document, DocumentSpan span, CellBorderSides sides, BorderEdge? edge)
Parameters
documentWordDocumentThe document.
spanDocumentSpanThe span: both ends in one table.
sidesCellBorderSidesWhich edges.
edgeBorderEdgeThe border (style, width, color), or null for none.
Returns
- DocumentEdit
The edit; the caret stays where the span was.
Exceptions
- ArgumentException
An end is not in
document, the ends are not in one table, or the sides are not defined.