// JSCode
// Export to excel
Function automateexcel (){
VaR eltable = Document. getelementbyid ("datatable"); // the ID of the table to be exported.
VaR orangeref = Document. Body. createTextRange ();
Orangeref. movetoelementtext (eltable );
Orangeref.exe ccommand ("copy ");
VaR appexcel = new activexobject ("Excel. application ");
Appexcel. workbooks. Add (). worksheets. Item (1). paste ();
Appexcel. Visible = true;
Appexcel = NULL;
}
// Export to word
// Import the content of the specified page area to the word
Function allareaword ()
{
VaR owd = new activexobject ("word. application ");
VaR ODC = owd. Documents. Add );
VaR Orange = ODC. Range (0, 1 );
VaR eltable = Document. getelementbyid ("datatable ");
VaR sel = Document. Body. createTextRange ();
Sel. movetoelementtext (eltable );
// SEL. Select ();
Sel.exe ccommand ("copy ");
Orange. paste ();
Owd. application. Visible = true;
Owd = NULL;
}