Method SetShapeOutline
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
documentWordDocumentThe document that holds the shape.
shapeShapeRefThe shape.
colorColorRgb?The colour, or null for no line.
widthEmu?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
documentorshapeis null.- ArgumentException
The shape is not in
documentor 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.