title: Extract the ‘pdf’ file embedded in excel and save it in to a folder using c#
body: <p>I am working with C#.net 2.0, Office 2010 and Visual Studio 2005.</p>
  
  <p>I have an excel file with embedded <code>.pdf</code> and <code>.doc</code> files.<br>
  I am able to read and save the <code>.doc</code> file with this code:</p>
  
  <pre><code>if (inlineShape.OLEFormat.progID.StartsWith("word.document."))
  {
      inlineShape.OLEFormat.Activate();
      Word.Document document = inlineShape.OLEFormat.Object as Word.Document;
      FileInfo wfi = new FileInfo(fileName);
      object wfileName = (object)(explodedDirectory + wfi.Name + "." + docCount.ToString() + ".doc");
      object fileFormat = Word.WdSaveFormat.wdFormatDocument;
      document.SaveAs(ref wfileName, ref fileFormat, ref _missing, ref _missing, 
          ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, 
          ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, 
          ref _missing, ref _missing);
      document.Close(ref saveChanges, ref originalFormat, ref routeChanges);
      document = null;
  }
  </code></pre>
  
  <p>But I can't do anything with <code>.pdf</code>.</p>
  
  <p>I need to extract the <code>.pdf</code> file and save it in to a folder, thanks in advance.</p>