ar 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(test1);
  sel.select();
  sel.execCommand("Copy");
  orange.Paste();
  oWD.Application.Visible = true;
------代码和这个差不多 , 但是要写在服务器端 , 就是所谓的asp实现了但前提是服务器上要装office

解决方案 »

  1.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
    <meta name=ProgId content=Excel.Sheet>
    <meta http-equiv=Content-Type content="text/html; charset=utf-8">
    <meta name=Generator content="Microsoft Excel 11">
    <STYLE>
        v\:* { BEHAVIOR: url(#default#VML) }
    </STYLE>
    </HEAD><BODY><%   
      Dim oo  
    Response.Write  Request.form("param")
      Response.AddHeader   "Content-Disposition",   "attachment;   filename=1.xls"   
      %></BODY>
    </HTML>
    这样导到excel里面可以,就是上面的文字都没有了,如何处理
      

  2.   

    ar oWD = new ActiveXObject("Word.Application"); 
    这个在ie里面,会被拦截到所以不能用
      

  3.   


    ar oWD = new ActiveXObject("Word.Application"); --------在server端: set oWD = Server.CreateObject("Word.Application")
      

  4.   

    但是图表上的文字丢失如何处理呢
    如柱形图,横众坐标上的文字及标题等没有在doc中生成,
    如何解决此问题