Table of Contents

Method UngroupShape

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

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.

public static DocumentEdit UngroupShape(this WordDocument document, ShapeRef group)

Parameters

document WordDocument

The document that holds the group.

group ShapeRef

The group.

Returns

DocumentEdit

The edit; Before is where the group was and After past its shapes.

Remarks

Measured in Word: a shape's box is its box in the group scaled as the group is, turned and mirrored about the group's centre with the group's turn added to its own; it takes the group's wrap and is stacked from where the group was. Word anchors each to the paragraph at its top edge; DocWright keeps them at the group's anchor with the offsets that put them in the same place (the caller has the layout to re-anchor one).

Exceptions

ArgumentNullException

An argument is null.

ArgumentException

The group is not in document or not in a paragraph.

InvalidOperationException

The drawing is not one group of DrawingML shapes (it holds a picture or a group), is in line with text or positioned by alignment, or is in a shape's text box.