Method SetShapeRotation
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
documentWordDocumentThe document that holds the shape.
shapeShapeRefThe shape.
rotationintThe rotation in 60000ths of a degree, clockwise; any value, taken as the angle it is.
flipHorizontalboolWhether the shape is mirrored left to right.
flipVerticalboolWhether 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
documentorshapeis null.- ArgumentException
The shape is not in
documentor 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.