Table of Contents

Method SetCellBorders

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

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

document WordDocument

The document.

span DocumentSpan

The span: both ends in one table.

sides CellBorderSides

Which edges.

edge BorderEdge

The 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.