sandy jo

sandy jo

  • NA
  • 4
  • 10.7k

Extract the ‘pdf’ file embedded in excel and save it in to a folder using c#

Aug 22 2011 3:43 AM

Hi All,

         I have an excel file with embed 'pdf' and 'doc' files.

I am able to read and save the 'doc' file.


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;

   }

But can't do anything with pdf.

I need to extract the 'pdf' file and save it in to a folder.


Thanks in Advance

Sandy


Answers (1)