title: Copy Image between documents using OpenXml and C#
body: <p>I have two documents, I need to copy a picture from one document to the other. I can't use altChunks because I need to do further editing on the file. </p>
  
  <p>I tried taking a clone of the sdtBlock that the image is in and appending that to the other document.</p>
  
  <p>Like..</p>
  
  <pre><code> sdtBlock = document2.Decendants&lt;StdBlock&gt;.First().Clone(); //Block with image and text etc...
   WordprocessingDocument oDoc = WordprocessingDocument.Open(document1, true);
   Body body = oDoc.MainDocumentPart.Document.Body;
   body.InsertAfter(sdtBlock, body.Elements&lt;Paragraph&gt;().First()); //insert block into new doc
  </code></pre>
  
  <p>That works for everything except the image. The image appears as either a red X or the document shows as corrupt. If you take the image out this method works fine.</p>
  
  <p>Looking on msdn I think its because I need to create a relationship for that image?</p>
  
  <p>Can anyone show me how this is possible?</p>
  
  <p>Thanks!</p>