Table of Contents

Method SetShapeFill

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

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

document WordDocument

The document that holds the shape.

shape ShapeRef

The shape.

color ColorRgb?

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

document or shape is null.

ArgumentException

The shape is not in document or 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.