Table of Contents

Method GroupShapes

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

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.

public static DocumentEdit GroupShapes(this WordDocument document, IReadOnlyList<PlacedShape> shapes, Paragraph target, Emu horizontalOffset, Emu verticalOffset)

Parameters

document WordDocument

The document that holds the shapes.

shapes IReadOnlyList<PlacedShape>

The shapes, each with where its box (before any turn) is: a page's coordinates, or any one space for all of them. At least two.

target Paragraph

The paragraph the group is anchored to: Word's is the one at the group's top edge.

horizontalOffset Emu

The group's left from the column of target.

verticalOffset Emu

The group's top from the top of target.

Returns

DocumentEdit

The edit; After is just past the group, at the start of target.

Remarks

Measured in Word: the group is In Front of Text, positioned from the column and the paragraph whatever its shapes were, and stacked where the lowest of them was; its box is the union of their boxes before any turn; each shape keeps its own size, turn and look, named and numbered inside it as it was. The shapes are removed from where they were anchored.

Exceptions

ArgumentNullException

An argument is null.

ArgumentException

Fewer than two shapes, a shape named twice, a shape or the paragraph not in document, or a shape in another part than the paragraph.

ArgumentOutOfRangeException

The group's box is wider or taller than 22 inches, or an offset is out of range.

InvalidOperationException

A shape is not one floating DrawingML shape (a picture, a group, a shape in line with text), or is in a shape's text box; or the paragraph is in a shape's text box.