< script language="javascript"> function tableToExcel() { window.clipboardData.setData("Text",document.all('theObjTable').outerHTML); try { var ExApp = new ActiveXObject("Excel.Application"); var ExWBk = ExApp.workbooks.add(); var ExWSh = ExWBk.worksheets(1); ExApp.DisplayAlerts = false; ExApp.visible = true; } catch(e) { alert("Microsoft Excel software is not installed on your computer! "); return false; } ExWBk.worksheets(1).Paste; } function tableToWord() { 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(theObjTable); sel.select(); sel.execCommand("Copy"); oRange.Paste(); oWD.Application.Visible = true; }
**************************************** *************************************************** **************** 5. About the method of using js to directly convert the content in the web page into excel **************** *************************************************** ***************************************
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn