title: Is there a way in word VBA to find an embedded picture (inlineShape) extension (jpeg, png, emf...)?
body: <p>I am trying to determine in a docx document the extension of the embedded images.
  This open xml document may have been generated by another user, with Microsoft Word or OpenOffice.
  Images have been embedded through the ribbon, or drag and drop, and they can be inlineShape (mose of the time), or Shape.
  I need to access the extension, because the document is then (not in my jurisdiction) parsed and converted to pdf, and some image extension are not compatible with the processe (namely emf of wmf).</p>
  
  <p>These images may not have names, nor alternativeText properties.
  The linkFormat property is not available either, since they are embedded.
  By looking through the ActiveDocument.WordOpenXML string, I can know if there are such images. But then, I can not link them to the corresponding shape in the document to identify which image will be problematic.
  Since they are embedded, the folder media in the docx zip contains the image, and they are linked to ids in the document through the document.xml.rels, e.g. </p>
  
  <pre><code>&lt;Relationship Target="media/image1.emf" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Id="rId8"/&gt;
  </code></pre>
  
  <p>Now I can find in the document.xml where is used that rId8 :</p>
  
  <pre><code>&lt;w:drawing&gt;
    &lt;wp:inline distT="0" distB="0" distL="0" distR="0" wp14:anchorId="59736095" wp14:editId="3A4D29FE"&gt;
      &lt;wp:extent cx="1286510" cy="712470"/&gt;
      &lt;wp:effectExtent l="0" t="0" r="8890" b="0"/&gt;
      &lt;wp:docPr id="2" name="Picture 2"/&gt;
      &lt;wp:cNvGraphicFramePr&gt;
        &lt;a:graphicFrameLocks noChangeAspect="1"/&gt;
      &lt;/wp:cNvGraphicFramePr&gt;
      &lt;a:graphic&gt;
        &lt;a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture"&gt;
          &lt;pic:pic&gt;
            &lt;pic:nvPicPr&gt;
              &lt;pic:cNvPr id="0" name="Picture 2"/&gt;
              &lt;pic:cNvPicPr&gt;
                &lt;a:picLocks noChangeAspect="1" noChangeArrowheads="1"/&gt;
              &lt;/pic:cNvPicPr&gt;
            &lt;/pic:nvPicPr&gt;
            &lt;pic:blipFill&gt;
              &lt;a:blip r:embed="rId8" cstate="print"&gt;
                &lt;a:extLst&gt;
                  &lt;a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}"&gt;
                    &lt;a14:useLocalDpi val="0"/&gt;
                  &lt;/a:ext&gt;
                &lt;/a:extLst&gt;
              &lt;/a:blip&gt;
              &lt;a:srcRect/&gt;
              &lt;a:stretch&gt;
                &lt;a:fillRect/&gt;
              &lt;/a:stretch&gt;
            &lt;/pic:blipFill&gt;
            &lt;pic:spPr bwMode="auto"&gt;
            &lt;/pic:spPr&gt;
          &lt;/pic:pic&gt;
        &lt;/a:graphicData&gt;
      &lt;/a:graphic&gt;
    &lt;/wp:inline&gt;
  &lt;/w:drawing&gt;
  </code></pre>
  
  <p>From there on I am stuck! What to do with any of this data ?
  The parent node of the drawing is a paragraph, with an id</p>
  
  <pre><code>w14:paraId="78D01A35"
  </code></pre>
  
  <p>but this is the only instance of the id in the ActiveDocument.WordOpenXML string.</p>
  
  <p>I would like to have pointers as to where I can look.
  From what I understand, when Word parses the docx and builds the object model, it converts the relationship links into inlineShape with anchors at the good location.
  But it somehow loses all reference to the picture name or location within the docx zip.</p>
  
  <p>P.S. : I need to find a solution in vba word</p>