0

我设计了信息路径表单。我正在为按钮单击事件编写所需的编程代码。但是在发布 infopath 表单时,我遇到了在此处输入图像描述错误;请注意:它应该允许我选择“表单库”选项,以便我可以这样做。从微软这里建议我需要删除代码。但一切都是我的形式所必需的。我需要使用代码部署表单。没有代码就没有任何价值。

我有幽会证书,而且我的表格完全信任。我的 infopath 服务配置正确。我在 2 层农场运行 sharepoint2010。我正在使用 Infopath 2010 和 Sharepoint 2010。我还需要添加什么...?

如果我删除代码,那么它会向我显示在此处输入图像描述并正确部署。请给我正确的方向。

    **Edited:** 
    I deployed this form as form template and activated it by central admin site. and assigned to form library as content type. but while running this form (from Document-> New Document->MyContentTypeTemplate),

 i got exception:

        Business logic failed due to an exception. 
        (User: domainname\user, Form Name: MHPMEmployeeInformationTemplateChanged9, IP: ,    Request: http://spwfe1:7000/_layouts/FormServer.aspx?

    XsnLocation=http://spwfe1:7000/FormServerTemplates/MHPMEmployeeInformationTemplateChanged9.xsn&SaveLocation=http:

    //spwfe1:7000/OfficialResumeFormLibrary&Source=http://spwfe1:7000/OfficialResumeFormLibrary/Forms/AllItems.aspx&DefaultItemOpen=1, Form ID: urn:schemas-microsoft-com:

    office:infopath:MHPMEmployeeInformationTemplateChanged9:-myXSD-2011-09-06T18-40-25, Type: UnauthorizedAccessException, Exception Message: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005.)    a2e8bb5f-26d2-485a-bf9c-0a333eaa71e7


        Verbose     Calling GlobalStorage.SetItem with index LastExceptionLogged value type UnauthorizedAccessException.    a2e8bb5f-26d2-485a-bf9c-0a333eaa71e7


        Medium      Exception thrown from business logic event listener: System.UnauthorizedAccessException:

 Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005.

     at EmployeeInformation_Template.DocGenerator.CreateWordDocument(Resume objResume, Object oTemplate)     

at EmployeeInformation_Template.FormCode.GetInfopathData()     at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass4.<RunWithElevatedPrivileges>b__2()   

  at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)    

 at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)     at 


Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)     at Employe...   a2e8bb5f-26d2-485a-bf9c-0a333eaa71e7

为什么要这样做?:我想知道微软何时避免使用 Interop COM Objects 来实现我在 infopath 表单中使用的 word 文件自动化。看这里

我现在必须做什么?我需要选择替代品吗?或通过尝试解决问题来移动???请,我需要正确的方向。

4

1 回答 1

0

这是设计使然。一旦您的表单中有代码,您唯一的选择就是部署为“管理员批准的表单”。

要让表单显示在您的库中,请执行以下操作:

  • 将其上传到管理中心(常规应用程序设置 -> 管理表单模板)
  • 在图书馆的“高级设置”部分中激活相应的功能
  • 允许“内容类型管理”
  • 将表单添加为 ContentType
于 2011-09-12T11:25:39.010 回答