Method MoveImage
MoveImage(WordDocument, ImageRef, DocumentPosition)
Moves a picture to a position, as dragging it does in Word.
public static DocumentEdit MoveImage(this WordDocument document, ImageRef image, DocumentPosition to)
Parameters
documentWordDocumentThe document that holds the picture.
imageImageRefThe picture.
toDocumentPositionWhere it goes, as the position is before the move.
Returns
- DocumentEdit
The edit; After is just past the picture at its new place. A position just before or just after the picture moves nothing and gives an empty edit.
Exceptions
- ArgumentNullException
documentorimageis null.- ArgumentException
The picture or the position is not in
document, the position is in another package part than the picture (a header, a note), or falls inside a surrogate pair.- InvalidOperationException
The position is inside content a reader synthesized, or the picture or the position is in a shape's text box.