XDocuments2.NewFromSolution 方法 (Object)

基于指定的表单模板创建新的 Microsoft InfoPath 表单。

命名空间:  Microsoft.Office.Interop.InfoPath.SemiTrust
程序集:  Microsoft.Office.Interop.InfoPath.SemiTrust(位于 Microsoft.Office.Interop.InfoPath.SemiTrust.dll 中)

语法

声明
Function NewFromSolution ( _
    varURI As Object _
) As XDocument
用法
Dim instance As XDocuments2
Dim varURI As Object
Dim returnValue As XDocument

returnValue = instance.NewFromSolution(varURI)
XDocument NewFromSolution(
    Object varURI
)

参数

  • varURI
    类型:System.Object

    指定表单的统一资源标识符 (URI)。

返回值

类型:Microsoft.Office.Interop.InfoPath.SemiTrust.XDocument
一个 _XDocument 对象。

实现

XDocuments.NewFromSolution(Object)

备注

NewFromSolution 方法只能基于现有表单模板来新建表单,不能基于表单来新建表单。若要从现有表单创建表单,请使用 New 方法。

使用 NewFromSolution 方法时,将在 InfoPath 中打开新表单并可以进行填写。

重要

此成员只能由与当前打开的表单在相同域中运行的表单访问,或者由已授予跨域权限的表单访问。

示例

在以下示例中,XDocumentsCollection 集合的 NewFromSolution 方法传递现有表单模板的 URI,并且将新建表单并返回与其关联的 _XDocument 对象:

XDocument newDocument;

newDocument = thisApplication.XDocuments. NewFromSolution (@"C:\MyForm.xsn");

另请参阅

引用

XDocuments2 接口

XDocuments2 成员

NewFromSolution 重载

Microsoft.Office.Interop.InfoPath.SemiTrust 命名空间