function AllAreaExcel ()
(
var oXL = new ActiveXObject ( "Excel.Application");
var oWB = oXL.Workbooks.Add ();
var oSheet = oWB.ActiveSheet;
var sel = document.body.createTextRange ();
sel.moveToElementText (export1);
sel.select ();
sel.execCommand ( "Copy");
oSheet.Paste ();
oXL.Visible = true;
)
/ / Export 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 (export1);
sel.select ();
sel.execCommand ( "Copy");
oRange.Paste ();
oWD.Application.Visible = true;
)
Note: export1 are derived DIV of id, such as <div> ... Export range ......</ div>, export1 value is "alove".
Error Handling: "automation server can not create object"
Safe mode set to "Medium", if javascript script this error is reported, should also be IE's security settings "are not allowed to run is not marked as safe activeX control" can be enabled.
Note If you set up the website as "trusted sites" must be "trusted sites" in the IE security settings at this time if the "Internet" IE settings would be futile
Of.







