就是一个button,点击一下,可以,把网页的内容生成word文件
可以保存的

解决方案 »

  1.   

    function AllAreaWord()
    {
      var oWD = new ActiveXObject("Word.Application");
      var oDC = oWD.Documents.Add("",0,1);
      var orange =oDC.Range(0,1);
      var sel = document.body.createTextRange();
      sel.moveToElementText(PrintA);
      sel.select();
      sel.execCommand("Copy");
      orange.Paste();
      oWD.Application.Visible = true;
    }
    导出
    StringWriter wr = new StringWriter();
     Server.Execute("", wr);   
     this.lit.Text = Server.HtmlEncode(wr.ToString());
     File.WriteAllText(Server.MapPath(""), wr.ToString());
    或res.ContentEncoding = System.Text.Encoding.UTF8;  
      res.ContentType = "application/vnd.ms-word";  
    导出