Table of Contents

Method SetShapeOutline

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

SetShapeOutline(WordDocument, ShapeRef, ColorRgb?, Emu?)

Sets a shape's line, as Word's Shape Outline does: a colour and a weight, or No Outline.

public static DocumentEdit SetShapeOutline(this WordDocument document, ShapeRef shape, ColorRgb? color, Emu? width = null)

Parameters

document WordDocument

The document that holds the shape.

shape ShapeRef

The shape.

color ColorRgb?

The colour, or null for no line.

width Emu?

The weight, or null to keep the line's own (the shape style's when the drawing states none).

Returns

DocumentEdit

The edit; a line the shape's drawing already states gives an empty edit.

Remarks

The line's dash, join and arrow heads stay as they are.

Exceptions

ArgumentNullException

document or shape is null.

ArgumentException

The shape is not in document or not in a paragraph; the colour is Auto.

ArgumentOutOfRangeException

The weight is negative or above MaxOutlineWidth.

InvalidOperationException

The shape is not one DrawingML shape, or it is in a shape's text box.