Method CopyImage
CopyImage(WordDocument, ImageRef, DocumentPosition)
Puts a copy of a picture at a position, as Ctrl+dragging it does in Word.
public static DocumentEdit CopyImage(this WordDocument document, ImageRef image, DocumentPosition to)
Parameters
documentWordDocumentThe document that holds the picture.
imageImageRefThe picture.
toDocumentPositionWhere the copy goes.
Returns
- DocumentEdit
The edit; After is just past the copy.
Exceptions
- ArgumentNullException
documentorimageis null.- ArgumentException
The picture or the position is not in
document, the position is in another package part than the picture, 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.