将当前网页生成word文件, 就是一个button,点击一下,可以,把网页的内容生成word文件可以保存的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 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"; 导出 求repeater分页代码 各位帮忙看一段js,关于 imagebutton 的 OnClientClick()事件 ScriptManager不执行 GridView 动态列的超连接 datatable中的单元格 设置空值 帮忙调试以下的代码?为何出错。 如何分析一个ASP.NET项目??望各位老大热心赐教!!!! 怎样使用存储过程中的参数? 利用本机SMTP服务器发送邮件 在北京呆腻了,想换换环境,请大家发表一下看法 数据库的一个问题,帮下忙 配置网站出错误:用户 'sa' 登录失败。该用户与可信 SQL Server 连接无关联。请教?
{
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";
导出