Method SetShapeGeometry
SetShapeGeometry(WordDocument, ShapeRef, string)
Changes a shape to another preset, as Word's Change Shape does; the preset's own adjust values apply.
public static DocumentEdit SetShapeGeometry(this WordDocument document, ShapeRef shape, string preset)
Parameters
documentWordDocumentThe document that holds the shape.
shapeShapeRefThe shape.
presetstringThe preset geometry, one of Names.
Returns
- DocumentEdit
The edit; the preset the shape already is, with no adjust values, gives an empty edit.
Exceptions
- ArgumentNullException
document,shapeorpresetis null.- ArgumentException
The shape is not in
documentor not in a paragraph; the preset is not one the format has.- InvalidOperationException
The shape is not one DrawingML shape, or it is in a shape's text box.