提取嵌入在Excel中的'pdf'文件,并使用c#将其保存到文件夹中 [英] Extract the ‘pdf’ file embedded in excel and save it in to a folder using c#

查看:498
本文介绍了提取嵌入在Excel中的'pdf'文件,并使用c#将其保存到文件夹中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



 我正在使用c#.net 2.0,office 2010,vs2005



         
我有一个excel文件嵌入‘ pdf’和‘ doc’文件。

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

我能够阅读并保存‘ doc’文件。

如果 (inlineShape .OLEFormat.progID.StartsWith(" word.document。" ))

 
  {

   
    inlineShape.OLEFormat.Activate();

       inlineShape.OLEFormat.Activate();

   
    Word。文档 document = inlineShape.OLEFormat.Object
as Word。文件;

       Word.Document document = inlineShape.OLEFormat.Object as Word.Document;

    ; 
     FileInfo wfi =
new FileInfo (fileName);

       FileInfo wfi = new FileInfo(fileName);

   
    object wfileName =( object )(explosionDirectory + wfi.Name +
"。" + docCount.ToString()+
" .doc"
);

       object wfileName = (object)(explodedDirectory + wfi.Name + "." + docCount.ToString() + ".doc");

   
    object fileFormat = Word。 WdSaveFormat .wdFormatDocument;

       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, r ef _missing,
ref _missing, ref _missing,
< span style ="color:blue"> ref
_missing, ref _missing,
ref _missing);

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);

ref saveChanges,
ref originalFormat, ref routeChanges);

      document.Close(ref saveChanges, ref originalFormat, ref routeChanges);

null ;

      document = null;

   
}

但是不能用pdf做任何事情。  

我需要提取‘ pdf’文件并将其保存到文件夹中。



提前致谢

Sandy

 

 

 

 

推荐答案

欢迎使用MSDn论坛。

Welcome to MSDn Forums.

还请在
http://social.msdn.microsoft.com/Forums/en/exceldev/threads
 (Excel For Developers Forum),您可以找到更多相关专家。

Please also try your query at http://social.msdn.microsoft.com/Forums/en/exceldev/threads (Excel For Developers Forum) where you'll find more related experts.

谢谢!


这篇关于提取嵌入在Excel中的'pdf'文件,并使用c#将其保存到文件夹中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆