之前看过别人的帖子,不过没弄明白
希望高人们给些完整的代码。
小菜鸟先谢啦~

解决方案 »

  1.   

    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
      

  2.   

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

  3.   

    1、你的电脑里要安装有office;
    2、而且安装的时候,要选择PIA程序集和VBA支持。
    3、或者是你的VS在安装的时候,还要安装一个工具VSTO。不然你是引用不起microsoft.office.interop.word的。
      

  4.   

    参见我的BLOG,操作EXCEL,WORD和这差不多的
    http://blog.csdn.net/yumanqing/archive/2007/01/06/1475393.aspx