Click here to Skip to main content
15,746,302 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
I am working with C#.net2.0,office 2010, vs2005. I have an excel file with embed ‘pdf’ and ‘doc’ files. I am able to read and save the ‘doc’ file. But can’t do anything with pdf. I need to extract the ‘pdf’ file and save it in to a folder.
if (inlineShape.OLEFormat.progID.StartsWith("word.document."))
       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;

Thanks in Advance.
Updated 23-Aug-11 19:36pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900