asp.net2.0导出生成word_asp.netusing  System;

asp.net2.0导出生成word_asp.net using  System.Data;

asp.net2.0导出生成word_asp.net using  System.Configuration;

asp.net2.0导出生成word_asp.net using  System.Collections;

asp.net2.0导出生成word_asp.net using  System.Web;

asp.net2.0导出生成word_asp.net using  System.Web.Security;

asp.net2.0导出生成word_asp.net using  System.Web.UI;

asp.net2.0导出生成word_asp.net using  System.Web.UI.WebControls;

asp.net2.0导出生成word_asp.net using  System.Web.UI.WebControls.WebParts;

asp.net2.0导出生成word_asp.net using  System.Web.UI.HtmlControls;

asp.net2.0导出生成word_asp.net public   partial   class  Default4 : System.Web.UI.Page

asp.net2.0导出生成word_asp.net_12asp.net2.0导出生成word_自定义_13 ... {

asp.net2.0导出生成word_html_14    protected void Page_Load(object sender, EventArgs e)

asp.net2.0导出生成word_html_15asp.net2.0导出生成word_asp.net_16    ...{

asp.net2.0导出生成word_返回结果_17    }

asp.net2.0导出生成word_html_14    protected void Button_Click(object sender, EventArgs e)

asp.net2.0导出生成word_html_15asp.net2.0导出生成word_asp.net_16    ...{

asp.net2.0导出生成word_html_14        Object Nothing = System.Reflection.Missing.Value;

asp.net2.0导出生成word_html_14        //取得Word文件保存路径

asp.net2.0导出生成word_html_14        object filename = @SaveAs.Text;

asp.net2.0导出生成word_html_14        //创建一个名为WordApp的组件对象

asp.net2.0导出生成word_html_14        Word.Application WordApp = new Word.ApplicationClass();

asp.net2.0导出生成word_html_14        //创建一个名为WordDoc的文档对象

asp.net2.0导出生成word_html_14        Word.Document WordDoc = WordApp.Documents.Add(ref Nothing, ref Nothing, ref Nothing, ref Nothing);

asp.net2.0导出生成word_html_14        //增加一表格

asp.net2.0导出生成word_html_14        Word.Table table = WordDoc.Tables.Add(WordApp.Selection.Range, 3, 3, ref Nothing, ref Nothing);

asp.net2.0导出生成word_html_14        //在表格第一单元格中添加自定义的文字内容

asp.net2.0导出生成word_html_14                table.Cell(1, 1).Range.Text = wordText.Text;

asp.net2.0导出生成word_html_14        //在文档空白地方添加文字内容

asp.net2.0导出生成word_html_14        WordDoc.Paragraphs.Last.Range.Text = "Wellcome To Aspxcn.Com";

asp.net2.0导出生成word_html_14        //将WordDoc文档对象的内容保存为DOC文档

asp.net2.0导出生成word_html_14        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);

asp.net2.0导出生成word_html_14        //关闭WordDoc文档对象

asp.net2.0导出生成word_html_14        WordDoc.Close(ref Nothing, ref Nothing, ref Nothing);

asp.net2.0导出生成word_html_14     

asp.net2.0导出生成word_html_14        //关闭WordApp组件对象

asp.net2.0导出生成word_html_14        WordApp.Quit(ref Nothing, ref Nothing, ref Nothing);

asp.net2.0导出生成word_html_14       

asp.net2.0导出生成word_html_14        //返回结果

asp.net2.0导出生成word_html_14        result.Text = "文档路径:<a href='" + SaveAs.Text + "'>" + SaveAs.Text + "</a>(点击链接查看)<br>生成结果:成功!";

asp.net2.0导出生成word_返回结果_17    }

asp.net2.0导出生成word_html_45}

asp.net2.0导出生成word_asp.net