XDocuments2.NewFromSolution Method (Object)

Creates a new Microsoft InfoPath 2010 form based on the specified form template.

Namespace:  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

Syntax

'Declaration
Function NewFromSolution ( _
    varURI As Object _
) As XDocument
'Usage
Dim instance As XDocuments2
Dim varURI As Object
Dim returnValue As XDocument

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

Parameters

  • varURI
    Type: System.Object

    Specifies the Uniform Resource Identifier (URI) of a form.

Return Value

Type: Microsoft.Office.Interop.InfoPath.SemiTrust.XDocument
An _XDocument object.

Implements

XDocuments.NewFromSolution(Object)

Remarks

The NewFromSolution method can only be used to create a new form based on an existing form template; it cannot be used to create a new form based on a form. To create a form from an existing form, use the New method.

When you use the NewFromSolution method, the new form opens in InfoPath and is ready to be filled out.

Important

This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

Examples

In the following example, the NewFromSolution method of the XDocumentsCollection collection is passed the URI of an existing form template, and a new form is created and its associated _XDocument object returned:

XDocument newDocument;

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

See Also

Reference

XDocuments2 Interface

XDocuments2 Members

NewFromSolution Overload

Microsoft.Office.Interop.InfoPath.SemiTrust Namespace