在项目中要将表格中的内容导出为word格式,所以就在网上找到一个脚本,xp系统下用着挺好的,但到了windows 7里边,问题就显现出来了,word主程序倒是也调用了,运行了,但却不能显示界面,只运行在后台,郁闷坏了,烦请各位支招!
【相关代码如下】
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(allData);
sel.select();
sel.execCommand("Copy");
oRange.Paste();
oWD.Application.Visible = true;
【相关代码如下】
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(allData);
sel.select();
sel.execCommand("Copy");
oRange.Paste();
oWD.Application.Visible = true;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货