Table of Contents

Method SetShapeRotation

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

SetShapeRotation(WordDocument, ShapeRef, int, bool, bool)

Sets a shape's rotation and whether it is mirrored, as Word's Rotate menu does.

public static DocumentEdit SetShapeRotation(this WordDocument document, ShapeRef shape, int rotation, bool flipHorizontal, bool flipVertical)

Parameters

document WordDocument

The document that holds the shape.

shape ShapeRef

The shape.

rotation int

The rotation in 60000ths of a degree, clockwise; any value, taken as the angle it is.

flipHorizontal bool

Whether the shape is mirrored left to right.

flipVertical bool

Whether the shape is mirrored top to bottom.

Returns

DocumentEdit

The edit; the values the shape already has give an empty edit.

Remarks

The values are written as stated: Word's Flip Horizontal on a turned shape also turns it the other way (30 degrees becomes 330), which a caller states as the new rotation.

Exceptions

ArgumentNullException

document or shape is null.

ArgumentException

The shape is not in document or not in a paragraph.

InvalidOperationException

The shape is not one DrawingML shape or one group of them with a transform, or it is in a shape's text box.