Method SetShapeFill
SetShapeFill(WordDocument, ShapeRef, ColorRgb?)
Sets a shape's fill, as Word's Shape Fill does: a colour, or No Fill.
public static DocumentEdit SetShapeFill(this WordDocument document, ShapeRef shape, ColorRgb? color)
Parameters
documentWordDocumentThe document that holds the shape.
shapeShapeRefThe shape.
colorColorRgb?The colour, or null for no fill.
Returns
- DocumentEdit
The edit; the fill the shape's drawing already states gives an empty edit.
Exceptions
- ArgumentNullException
documentorshapeis null.- ArgumentException
The shape is not in
documentor not in a paragraph; the colour is Auto.- InvalidOperationException
The shape is not one DrawingML shape, or it is in a shape's text box.