c#中讲某一表中的数据导出到word中
关于winform的,代码希望能够详细简单点。
------解决方案--------------------调用 "Word.Application" ActiveX控件。具体代码google一下吧。
------解决方案--------------------操作WORD配置说明  
引入:Word的对象库文件“MSWORD.OLB”(word 2000为MSWORD9.OLB)  
1.运行Dcomcnfg.exe  
2.组件服务――计算机――我的电脑――DCOM配置――找到microsoft word 文档  
3.点击属性  
4.选择“安全性”  
5.选定“使用自定义访问权限”和“使用自定义启动权限”  
6.分别编辑权限,添加Everyone(ASPNET,VS Developers,Debugger User)  
7.选择“身份标识”,在选定“交互式用户” 即可  
8.在Web.config里加 <identity impersonate="true"/>  
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Office.Interop.Word;
namespace WebWord
{
   public partial class _Default : System.Web.UI.Page
   {
       protected void Page_Load(object sender, EventArgs e)
       {
          Object Nothing=System.Reflection.Missing.Value;
          object filename = @"C:\Word.doc";  
          Microsoft.Office.Interop.Word.Application WordApp = new Microsoft.Office.Interop.Word.ApplicationClass();  
          Microsoft.Office.Interop.Word.Document WordDoc = WordApp.Documents.Add(ref Nothing, ref Nothing, ref Nothing, ref Nothing);           
           Microsoft.Office.Interop.Word.Table table = WordDoc.Tables.Add(WordApp.Selection.Range, 5, 5, ref Nothing, ref Nothing);
           table.Cell(1,1).Width = 40f;
          table.Cell(1,1).Range.Text="1";
          table.Cell(2,2).Range.Text = "2";
          table.Cell(3,3).Range.Text = "3";
          table.Cell(4,4).Range.Text = "4";
          table.Cell(5,5).Range.Text = "5";
          //WordDoc.Paragraphs.Last.Range.Text = "Wellcome To Aspxcn.Com";
          WordDoc.SaveAs(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);  
          WordDoc.Close(ref Nothing, ref Nothing, ref Nothing);  
          WordApp.Quit(ref Nothing, ref Nothing, ref Nothing);  
       }
   }
}