title: Update embedded excel file programmatically
body: <p>I'm trying to modify an embedded excel table in a word document programmatically. To do this, I have modified the docx file and the embedded excel file.</p>
  <p>The significant part of the main document is the following:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;w:object w:dxaOrig=&quot;8406&quot; w:dyaOrig=&quot;2056&quot;&gt;
    &lt;v:shape id=&quot;_x0000_i1028&quot; type=&quot;#_x0000_t75&quot; 
      style=&quot;width:390.75pt;height:95.25pt&quot; o:ole=&quot;&quot;&gt;&lt;v:imagedata r:id=&quot;rId14&quot; 
      o:title=&quot;&quot;/&gt;
    &lt;/v:shape&gt;
    &lt;o:OLEObject Type=&quot;Embed&quot; ProgID=&quot;Excel.Sheet.12&quot; ShapeID=&quot;_x0000_i1028&quot; 
      DrawAspect=&quot;Content&quot; ObjectID=&quot;_1349794876&quot; r:id=&quot;rId15&quot; 
      UpdateMode=&quot;Always&quot;/&gt;
  &lt;/w:object&gt;
  </code></pre>
  <p>The word document uses an OLEObject to link to the embedded excel document. For displaying purposes,
  a .wmf file is used (using the <code>v:shape</code> element). I have modified the excel document, which outdated this preview.</p>
  <p>This results in some strange behaviour in the document:</p>
  <ul>
  <li>The preview of the embedded (excel) table shows the wrong data</li>
  <li>Double clicking on the embedded table opens the table in an embedded excel and shows the correct data</li>
  <li>Closing the embedded editor triggers the generation of a new preview, showing the correct data</li>
  </ul>
  <p>Of course, I want the table to show the correct table when the document is opened. How can I trigger Word to discard the image and redraw the preview?</p>
  <p>An ideal solution for me would be to trigger the regeneration of the preview just by modifying the contents of the docx, but solutions using a small script would also help.</p>