WPS Office2007下载
首页 >> 技术文章 >> InfoPath2007


通过使用脚本自定义InfoPath 2007表单模板

添加当合并现有表单时运行的脚本

  1. “工具”菜单上,单击“表单选项”
  2. “表单选项”对话框的“类别”列表中,单击“高级”
  3. “合并表单”下,选中“启用表单合并”复选框。
  4. 选中“使用自定义代码合并”复选框,然后单击“编辑”。Microsoft 脚本编辑器将启动,且光标位于 OnMergeRequest 事件处理程序上。
  5. JScript

    //=======
    // The following function handler is created by Microsoft Office InfoPath.
    // Do not modify the name of the function, or the name and number of arguments.
    //=======
    function XDocument::OnMergeRequest(eventObj)
    {
    // Write the code that handles each form being merged here.

    XDocument.ImportDOM(eventObj.DOM);

    eventObj.ReturnStatus = true;
    }

    VBScript

    '=======
    ' The following function handler is created by Microsoft Office InfoPath.
    ' Do not modify the name of the function, or the name and number of arguments.
    '=======
    Sub XDocument_OnMergeRequest(eventObj)

    ' Write the code that handles each form being merged here.

    XDocument.ImportDOM(eventObj.DOM)

    eventObj.ReturnStatus = True
    End Sub
  6. 用您的代码替换注释 Write the code that handles each form being merged here. 。
  7. 要测试该事件中的代码,请发布表单模板,创建几个基于该表单模板的表单,然后合并表单模板。

     注释   在请参阅节中可以找到指向有关发布表单模板的详细信息的链接。


声明:欢迎各大网站转载本站文章,还请保留一条能直接指向本站的超级链接,谢谢!

第1页 | 第2页 | 第3页 | 第4页 | 第5页 | 第6页 | 第7页 | 第8页

时间:2007-7-19 21:16:20,点击:0打印】【关闭

上一篇:调试InfoPath 2007脚本
下一篇:创建事件处理程序

OfficeBa论坛】:阅读本文时遇到了什么问题,可以到论坛进行交流!Excel专家邮件:342327115@qq.com(大家在Excel使用中遇到什么问题,可以咨询此邮箱)。

【声明】:以上文章或资料除注明为Office吧自创或编辑整理外,均为各方收集或网友推荐所得。其中摘录的内容以共享、研究为目的,不存在任何商业考虑。如有任何异议,请与本站联系,联系邮箱:thinkou@126.com,本站确认后将立即撤下。谢谢您的支持与理解!


相关评论

我要评论

查看所有评论内容

评论内容