zoukankan      html  css  js  c++  java
  • 在线编辑word文档代码

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml%22 > 
    <head runat="server"> 
    <title>在线编辑文档</title> 
    <script language="javascript" type="text/javascript"> 
    var __OpenDocuments = null ; 
    
    function documentEdit( url ) 
    { 
    if( __OpenDocuments == null ) { 
    try{ 
    __OpenDocuments = new ActiveXObject("SharePoint.OpenDocuments.3"); //for office 2007 
    } 
    catch(e){} 
    
    if( __OpenDocuments == null || typeof(__OpenDocuments) == "undefined" ) { 
    try{ 
    __OpenDocuments = new ActiveXObject("SharePoint.OpenDocuments.2"); //for office 2003 
    } 
    catch(e){} 
    } 
    
    if( __OpenDocuments == null || typeof(__OpenDocuments) == "undefined" ) { 
    alert( "请安装Word(2003或更高版本)" ); 
    return ; 
    } 
    } 
    var result = __OpenDocuments.EditDocument( url , "Word.Document" ); 
    
    if( result == false ) { 
    alert( "无法打开文档." ); 
    } 
    } 
    </script> 
    </head> 
    <body> 
    <form id="form1" runat="server"> 
    <div> 
    <input type="button" value="打开文档" onclick="documentEdit('http://moss07/ty/test/新建.doc');return false;" /> 
    <a href="#"  onclick="documentEdit('http://moss07/ty/test/新建.doc');return false;">点击</a>
    </div> 
    </form> 
    </body> 
    </html>
    

      

  • 相关阅读:
    Ecplilse使用
    JDK安装
    浏览器的前世今生
    RethinkDB
    [css]兼容性
    【js】undefined
    String面试题
    SOS.dll(SOS 调试扩展)
    【ajax跨域】原因原理解决
    腾讯WEB前端开发三轮面试经历及面试题
  • 原文地址:https://www.cnblogs.com/gxbk629/p/3584794.html
Copyright © 2011-2022 走看看