【Vegas原创】超简单的导出word方法

    //get BBS Content
        string strSubject = "" + drpType.SelectedValue.Trim() + "" + txtTitle.Text.Trim();
        StringBuilder sbContent 
= getMailContent(strSubject);
        
//print
        Response.Clear();
        Response.Buffer 
= true;
        Response.Charset 
= "GB2312";
        Response.AppendHeader(
"Content-Disposition""attachment;filename=FileName.doc");
        Response.ContentEncoding 
= System.Text.Encoding.UTF8;
        Response.Write(sbContent.ToString());
        Response.End();


注意:
ContentEncoding要选择UTF8



posted @ 2008-04-07 13:47  李济宏(Amadeus)  阅读(292)  评论(0编辑  收藏  举报