|
楼主 |
发表于 2020-4-16 15:45:01
|
显示全部楼层
Object Nothing=System.Reflection.Missing.Value ;
//取得Word文件保存路径
object filename="E:/站点//新建 Microsoft Word 文档.doc";
//创建一个名为WordApp的组件对象
Word.Application WordApp=new Word.ApplicationClass();
//打开文档对象
WordApp.Documents .Open (ref filename,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing);
this.read_tb .Text =WordApp.MailMessage .ToString ();
//保存
WordApp.ActiveDocument.SaveAs2000(ref filename,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing);
//关闭
WordApp.ActiveDocument.Close(ref Nothing,ref Nothing,ref Nothing);
WordApp.Quit(ref Nothing,ref Nothing,ref Nothing);
----------------------------
还是读不出来 |
|