Method SetShapeLayout
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.
public static DocumentEdit SetShapeLayout(this WordDocument document, ShapeRef shape, ImageAnchor? anchor)
Parameters
documentWordDocumentThe document that holds the shape.
shapeShapeRefThe shape.
anchorImageAnchorThe floating layout, or null to put the shape in line with text; completed as SetImageLayout(WordDocument, ImageRef, ImageAnchor?) completes a picture's.
Returns
- DocumentEdit
The edit; Before is just before the shape and After just past it. A layout the shape already has gives an empty edit.
Exceptions
- ArgumentNullException
documentorshapeis null.- ArgumentException
The shape is not in
documentor not in a paragraph; an anchor token is not one the format has.- ArgumentOutOfRangeException
An anchor's distance or offset is out of range.
- InvalidOperationException
The shape is not one DrawingML shape or one group of them (Phase 179), or it is in a shape's text box.