public static void AddImageToBody(this WordprocessingDocument wordDoc, BitmapSource image) { var drawing = wordDoc.GetDrawingFromImage(image); wordDoc.MainDocumentPart.Document.Body.AppendChild(new Paragraph(new Run(drawing))); }
public static OpenXmlElement InsertImageAfter(this WordprocessingDocument wordDoc, OpenXmlElement appendAfter, BitmapSource image) { var drawing = wordDoc.GetDrawingFromImage(image); return wordDoc.MainDocumentPart.Document.Body.InsertAfter(new Paragraph(new Run(drawing)), appendAfter); }