Table of Contents

Method SetShapeLayout

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

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

document WordDocument

The document that holds the shape.

shape ShapeRef

The shape.

anchor ImageAnchor

The 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

document or shape is null.

ArgumentException

The shape is not in document or 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.