Table of Contents

Method ReanchorImage

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

ReanchorImage(WordDocument, ImageRef, Paragraph, ImageAnchor)

Moves a floating picture's anchor to the start of another paragraph and gives it a position there, as dragging the picture does in Word (Phase 176, WQ-0157: the anchor goes to the paragraph at the picture's new top edge, at its start). One undo step.

public static DocumentEdit ReanchorImage(this WordDocument document, ImageRef image, Paragraph target, ImageAnchor anchor)

Parameters

document WordDocument

The document that holds the picture.

image ImageRef

The floating picture.

target Paragraph

The paragraph it is anchored to now.

anchor ImageAnchor

Its layout options there (the position the caller worked out for the new paragraph).

Returns

DocumentEdit

The edit; After is just past the picture at its new place.

Exceptions

ArgumentNullException

An argument is null.

ArgumentException

The picture or the paragraph is not in document, or they are in different parts.

InvalidOperationException

The picture is not floating, or is in a shape's text box.