有思俱乐部学习园地

打开微软的Office文档


语法格式:

打开微软的Office文档,包括word,excel,ppt等。 参数一:文件类型 参数二:服务器路径 Open(string filetype,string
    filepath); 调用方法: U.A.Request("office.Open", [filetype, filepath]); //生成word网页版 
            

前端javascript调用数据库存储过程示例(可在编辑区域修改参数):

U.A.Request("http://office.1473.cn/Officetohtml.ashx", ["Open", "doc", "0035a11d-2dcf-4057-bb87-a72a4095249f.doc"],function(r){
    r = r.value;
    $('#resultarea')[0].innerText = '文件路径: ' + r.path;
    var content = /<body[^>]*>([\s\S]*)<\/body>/.exec(r.value);
    if(content && content[1]){
        $('#resultarea')[0].innerText += '\n 文件内容: \n' + content[1];
    }
});

运行结果展示区域: