将指定网页保存为Excel
[ 2007-12-10 16:08:05 | 作者: admin ]
<script language="javascript">
function AllAreaExcel(ID)
{
var oXL = new ActiveXObject("Excel.Application");
var oWB = oXL.Workbooks.Add();
var oSheet = oWB.ActiveSheet;
var sel=document.body.createTextRange();
sel.moveToElementText(ID);
sel.select();
sel.execCommand("Copy");
oSheet.Paste();
oXL.Visible = true;
}
</script>
使用:利用<div id="test">要保存的页面内容</div><input ...
阅读全文…
function AllAreaExcel(ID)
{
var oXL = new ActiveXObject("Excel.Application");
var oWB = oXL.Workbooks.Add();
var oSheet = oWB.ActiveSheet;
var sel=document.body.createTextRange();
sel.moveToElementText(ID);
sel.select();
sel.execCommand("Copy");
oSheet.Paste();
oXL.Visible = true;
}
</script>
使用:利用<div id="test">要保存的页面内容</div><input ...
阅读全文…
1