function CellAreaExcel(){
//以Excel打开
var oXL = new ActiveXObject("Excel.Application");
var oWB=oXL.Workbooks.Add();
var oSheet = oWB.ActiveSheet;
var Lenr = PrintA.rows.length;
for(i=0;i
var Lenc = PrintA.rows(i).cells.length;
for(j=0;j
oSheet.Cells(i+1,j+1).value=PrintA.rows(i).cells(j).innerText;
}
}
oXL.Visible = true;
}
//指定页面区域内容以Excel打开
function AllAreaExcel(){
var oXL = new ActiveXObject("Excel.Application");
var oWB = oXL.Workbooks.Add();
var oSheet = oWB.ActiveSheet;
var sel = document.body.createTextRange();
sel.moveToElementText(PrintA);
sel.select();
sel.execCommand("Copy");
oSheet.Paste();
oXL.Visible = true;
}
//指定页面区域内容以Word打开
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;
}
S0A1 | |
S1 | A1 |
S2 | A2 |
S3 | A3 |