js 不能实现吧?
ms 没有调用系统的权限!

解决方案 »

  1.   

    完全可以 ,js调 客户端 office 的权限一般还是有的相关命名空间:
    word.application
    excel.application
      

  2.   

    tantaiyizu 
    痴情客 
    等 级:
     发表于:2008-02-01 15:26:332楼 得分:0 
    完全可以   ,js调   客户端   office   的权限一般还是有的 相关命名空间: 
    word.application 
    excel.application 
     
    ?
      

  3.   

     <script language="javascript"> 
    function OpenWord(){ 
    Layer1.style.border=0 
    ExcelSheet = new ActiveXObject('word.Application'); 
    ExcelSheet.Application.Visible = true; var mydoc=ExcelSheet.Documents.Add('',0,1); 
    myRange =mydoc.Range(0,1) var sel=Layer1.document.body.createTextRange() 
    sel.select() 
    Layer1.document.execCommand('Copy') sel.moveEnd('character') 
    myRange.Paste(); location.reload() 
    ExcelSheet.ActiveWindow.ActivePane.View.Type=9 } </script> 
    <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
    <title>网页上内容导出到word</title> </head> 
    <body> 
    <div id="Layer1" > 
    <input type=button name='button_export' title='导出到word' onclick=OpenWord() value="下载到word"></div> </div> <table align="center" width="300" border="1" bordercolor="#2baeff" cellpadding="0" cellspacing="0" bgcolor="lightblue"> <Tr><Td>1</td><Td>2</td><Td>3</td></tr> <Tr><Td>4</td><Td>5</td><Td>6</td></tr> <Tr><Td>7</td><Td>8</td><Td>9</td></tr> </table> 
    </body> </html> 
     
    接分
      

  4.   

     <script language="javascript">
     function tableToExcel(tname) {
      if(confirm('是否要导出到excel?')!=0)
      { 
       window.clipboardData.setData("Text",document.all(tname).outerHTML);
       try
       {
        ExApp = new ActiveXObject("Excel.Application")
        var ExWBk = ExApp.workbooks.add()
        var ExWSh = ExWBk.worksheets(1)
        ExApp.DisplayAlerts = false
        ExApp.visible = true
       }  
       catch(e)
       {
        alert("导出没有成功!1.您的电脑没有安装Microsoft Excel软件!2.请设置Internet选项自定义级别,对没有标记安全级别的  ActiveX控件进行提示。")
        return false
       } 
        ExWBk.worksheets(1).Paste;
       }else
       { 
       return;
      }
      }
    </script>
    这个可以,当是要设置浏览器的安全级别