• web编辑word之dsoframer(二)


    dsoframer API:

     /*10.显示或隐藏修订内容

     ShowRevisions(long nNewValue)

     nNewValue = 0 则隐藏修订 = 1 则显示修订 */

    //显示修订留痕

     document.all.FramerControl1.ShowRevisions(1);

     //隐藏修订留痕 document.all.FramerControl1.ShowRevisions(0); /*

     11.插入合并文件, strFieldPath 文件路径,可以是http,ftp的路径 pPos = 0

    //当前鼠标位置

    1;文件开头

    2;文件末尾 pPos的第4位为1的时候,代表插入的是图片 InSertFile(BSTR strFieldPath, long lPos) */

    //文件头部插入文件

     document.all.FramerControl1.InSertFile("http://XX.com/XX.doc",1);

     //文件尾部插入文件 document.all.FramerControl1.InSertFile("http://XX.com/XX.doc",2);

    //当前光标位置插入文件 document.all.FramerControl1.InSertFile("http://XX.com/XX.doc",0);

     //文件头部插入图片 document.all.FramerControl1.InSertFile("http://XX.com/XX.jpg",9);

     //文件尾部插入图片 document.all.FramerControl1.InSertFile("http://XX.com/XX.jpg",10);

    //当前光标位置插入图片 document.all.FramerControl1.InSertFile("http://XX.com/XX.jpg",8);

    /* 0x31. 文档另存为 HRESULT SaveAs([in] VARIANT strFileName, [in] VARIANT dwFileFormat, [out,retval] long* pbool);

     参数: strFileName:文件本地路径,如c:\\11.doc dwFileFormat: 文件格式 dwFileFormat的数值为:

     Excel: Type  Word: Type PPT:Type

    删除本地文件

    HRESULT DeleteLocalFile([in] BSTR strFilePath);参数strFileName:文件本地路径,如c:\\11.doc

    创建临时文件

    HRESULT GetTempFilePath([out,retval] BSTR* strValue);返回临时文件的路径地址。使用完后,用DeleteLocalFile 删除

    设置文档显示模式HRESULT ShowView([in] long dwViewType, [out,retval] long *pbool);

    dwViewType的可取值为: enum WdViewType { wdNormalView = 1, wdOutlineView = 2,

     wdPrintView = 3, wdPrintPreview = 4, wdMasterView = 5, //这个是大纲 wdWebView = 6 }; */

    //大纲模式 document.all.FramerControl1.ShowView(5);

    下载远程文件

    HRESULT DownloadFile( [in] BSTR strRemoteFile, [in] BSTR strLocalFile, [out,retval]BSTR* strValue);

    参数:strRemoteFile:远程路径地址,http or Ftp

    strLocalFile: 本地保存地址,if strLocalFile == NULL then Create Temp File and return TempFile's Path

    增加Http上传时候的,附加其他文件

    HRESULT HttpAddPostFile([in] BSTR strFileID, [in]BSTR strFileName, [out,retval] long* pbool);

    参数strFileID:文件的ID,供服务器端页面解析

        strFileName: 本地文件地址

    //设置文件只读密码

     document.all.FramerControl1.SetValue("password","::DOCPROP:PassWord");

    //设置文件修改密码

    document.all.FramerControl1.SetValue("password","::DOCPROP:WritePW");

    分页保存

    HRESULT SetPageAs([in] BSTR strLocalFile, [in]long lPageNum, [in]long lType,[out,retval] long* pbool);

    strLocalFile:本地路径 lPageNum:页数 */

     下载文件codehttps://files.cnblogs.com/linsu/DSOFramer_0521.rar

  • 相关阅读:
    mac安装浏览器同步测试工具
    感觉自己不幸福怎么办?
    React组件
    常用的网页加载进度条
    浅析百分百还原网站效果图的可行性分析
    关于后台权限
    第一阶段:Python开发基础 day04  Python基础语法入门--Python基本数据类型
    第一阶段:Python开发基础 day03 Python基础语法入门--Python基础知识
    第一阶段:Python开发基础 Python基础语法入门  day03 课后作业
    第一阶段:Python开发基础 基础语法入门-- day02 编程语言分类
  • 原文地址:https://www.cnblogs.com/linsu/p/2308104.html
Copyright © 2020-2023  润新知