Class ShapeEditingExtensions
Shapes edited as Word edits them (Phase 164): inserted from a preset, moved and wrapped, resized, turned and mirrored, refilled, re-outlined and changed to another preset. Each is one DocumentEdit, undone to exactly what was there.
public static class ShapeEditingExtensions
- Inheritance
-
ShapeEditingExtensions
- Inherited Members
Remarks
These edit a single DrawingML shape (wps:wsp): not a group, a canvas, a picture in a shape or a VML
shape. The change is written into the shape's drawing (Word's spelling, tools/Probe-WordShapes.ps1) and
into the model layout draws from.
Word saves a shape twice, as a DrawingML choice and a VML fallback inside mc:AlternateContent. An
edit here writes the shape as the choice alone, with the change in it; Word opens that as its own and writes the
fallback again on its next save (measured). A shape whose text alone was edited keeps both copies.
Fields
- MaxOutlineWidth
The heaviest line DrawingML has (ST_LineWidth): 20116800 EMU, 1584 points.
Methods
- GroupShapes(WordDocument, IReadOnlyList<PlacedShape>, Paragraph, Emu, Emu)
Groups floating shapes as Word's Group does: one drawing in front of text whose box is the shapes' boxes taken together, the shapes inside it in their stacking order, anchored at the start of
target. One undo step.
- InsertLine(WordDocument, DocumentPosition, ShapeLineKind, Emu, Emu, bool, bool, ImageAnchor?)
Inserts a line or a connector as Word's Insert > Shapes > Lines draws one (Phase 178, WQ-0159): floating in front of text, in Word's line style (the theme's first accent, no fill), with the arrowheads its kind has.
- InsertShape(WordDocument, DocumentPosition, string, Emu, Emu, ImageAnchor?)
Inserts a shape as Word's Insert > Shapes does: floating in front of text, in the theme's colours.
- ResizeShape(WordDocument, ShapeRef, Emu, Emu)
Resizes a shape, as dragging its handles or the Size boxes of Shape Format do.
- SetShapeDash(WordDocument, ShapeRef, ShapeDash)
Sets a shape's dash, as Word's Shape Outline > Dashes does (Phase 178, WQ-0159).
- SetShapeFill(WordDocument, ShapeRef, ColorRgb?)
Sets a shape's fill, as Word's Shape Fill does: a colour, or No Fill.
- SetShapeGeometry(WordDocument, ShapeRef, string)
Changes a shape to another preset, as Word's Change Shape does; the preset's own adjust values apply.
- SetShapeLayout(WordDocument, ShapeRef, ImageAnchor?)
Sets how a shape sits in the text: in line with it, or floating with a wrap, a position and a distance from text.
- SetShapeLineEnds(WordDocument, ShapeRef, ShapeLineEndKind, ShapeLineEndKind)
Sets a shape's arrowheads, as Word's Shape Outline > Arrows does (Phase 178): each end's type, or none.
- SetShapeOutline(WordDocument, ShapeRef, ColorRgb?, Emu?)
Sets a shape's line, as Word's Shape Outline does: a colour and a weight, or No Outline.
- SetShapeRotation(WordDocument, ShapeRef, int, bool, bool)
Sets a shape's rotation and whether it is mirrored, as Word's Rotate menu does.
- UngroupShape(WordDocument, ShapeRef)
Takes a group's shapes out of it as Word's Ungroup does: each a floating shape again, where the group drew it, with the group's wrap and its own size, turn and look. One undo step.