title: Reading images from Word files using C# Word API without using Clipboard
body: <p>I've been working on an application to read images from multiple word files and store them in one single word file using <code>Microsoft.Office.Interop.Word</code> in C#
  <br><br>
  <strong>EDIT</strong>: I also need to save a copy of the images on the file system, so I need the image in a Bitmap or similar object.
  <br><br>
  <a href="http://pastebin.com/ymt2n4hT" rel="nofollow noreferrer">This</a> is my implementation so far, which works fine:</p>
  
  <pre><code>        foreach (InlineShape shape in doc.InlineShapes)
          {
              shape.Range.Select();
              if (shape.Type == WdInlineShapeType.wdInlineShapePicture)
              {
                  doc.ActiveWindow.Selection.Range.CopyAsPicture();
                  ImageData = Clipboard.GetDataObject();
                  object _ob1 = ImageData.GetData(DataFormats.Bitmap);
                  bmp = (Bitmap)_ob1;
                  images[i++] = bmp;
                  /*
                  bmp.Save("C:\\Users\\Akshay\\Pictures\\bitmaps\\test" + i.ToString() + ".bmp");
                  */
              }
          }
  </code></pre>
  
  <p><br><br>
  I have:</p>
  
  <ul>
  <li>Selected the images as <code>InlineShapes</code></li>
  <li>Copied the shape into Clipboard</li>
  <li>Stored the shape in the Clipboard in a <code>DataObject</code></li>
  <li>Extracted the shape from the <code>DataObject</code> in <code>Bitmap</code> format and stored in a <code>Bitmap</code> object.</li>
  </ul>
  
  <p><br><br>
  I've been told to refrain from using Clipboard in Word automation and use the Word APIs instead.
  I've read up on it and found an <a href="https://stackoverflow.com/a/16017211/2129255">SO answer</a> stating the same.</p>
  
  <p><br><br>
  I looked up many implementations of reading images from Word files on <code>MSDN</code>, <code>SO</code> etc. but could not find any without using clipboard.
  <br><br>
  How do I read images from Word files using the Word APIs from <code>Microsoft.Office.Interop.Word</code> namespace alone without using Clipboard ?
  <br><br></p>