C#程序如何打开 word文档 之前看过别人的帖子,不过没弄明白希望高人们给些完整的代码。小菜鸟先谢啦~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 using Microsoft.Office.Interop.Word Word.Document thisDocument = null; Word.Application thisApplication = null;//new Word.ApplicationClass(); CreateWordDocument("c: emp.doc",ref thisDocument,ref thisApplication); thisApplication.ShowMe() Asp.Net(C#)信息采集 群:39921387 using Microsoft.Office.Interop.Word ApplicationClass MyWord = new ApplicationClass(); Document MyDoc = null; string strPath = "xxx.doc"; object path = (object)strPath; object myTrue = true; object missingValue = Type.Missing; MyDoc = MyWord.Documents.Open(ref path, ref missingValue, ref myTrue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue); 1、你的电脑里要安装有office;2、而且安装的时候,要选择PIA程序集和VBA支持。3、或者是你的VS在安装的时候,还要安装一个工具VSTO。不然你是引用不起microsoft.office.interop.word的。 参见我的BLOG,操作EXCEL,WORD和这差不多的http://blog.csdn.net/yumanqing/archive/2007/01/06/1475393.aspx c# winform 上传文件的控件是什么? 无法加载指定的模块。。求指导 C# 键盘事件! c# office的问题 poi 窗体制定的问题,谢谢 如何在两个页面上传递DataGrid控件? 新手问题:我有文件夹book和oracle里都已有一个word.doc这个文件(但这两个word.doc文件内容不一样的),在winform中如何用命令实现在book文 关于打印的问题 添加DSOFramer.ocx引用后,发布安装包时怎么让用户在客户机自动完成注册。 System.AccessViolationException的问题,高分求解 在调试.net源程序中出现的问题,请大家给予帮助.
Word.Application thisApplication = null;//new Word.ApplicationClass(); CreateWordDocument("c: emp.doc",ref thisDocument,ref thisApplication); thisApplication.ShowMe() Asp.Net(C#)信息采集 群:39921387
ApplicationClass MyWord = new ApplicationClass();
Document MyDoc = null;
string strPath = "xxx.doc";
object path = (object)strPath;
object myTrue = true;
object missingValue = Type.Missing;
MyDoc = MyWord.Documents.Open(ref path, ref missingValue, ref myTrue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue);
2、而且安装的时候,要选择PIA程序集和VBA支持。
3、或者是你的VS在安装的时候,还要安装一个工具VSTO。不然你是引用不起microsoft.office.interop.word的。
http://blog.csdn.net/yumanqing/archive/2007/01/06/1475393.aspx