数据库为SQL,怎样才能生成word文档?谢谢!

解决方案 »

  1.   

    生成execl可以吗? 添加引用Microsoft.Office.Interop.Excel.dll,用法你自己搜吧
      

  2.   

    同理  引用Microsoft.Office.Interop.Word   生成word,具体代码 百度下吧
      

  3.   

    使用com组件创建word
    using Word = Microsoft.Office.Interop.Word;
    Microsoft.Office.Interop.Word.ApplicationClass app = new Microsoft.Office.Interop.Word.ApplicationClass();
    Word.Document doc= app.Documents.Add(ref missing, ref missing,ref missing, ref missing);