Share via


XDocuments3.NewFromSolutionWithInputParameters method

Creates a new form using the specified form template with the specified form template and input parameters

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

Syntax

'Declaration
Function NewFromSolutionWithInputParameters ( _
    varSolutionURI As Object, _
    varInputParams As Object _
) As XDocument
'Usage
Dim instance As XDocuments3
Dim varSolutionURI As Object
Dim varInputParams As Object
Dim returnValue As XDocument

returnValue = instance.NewFromSolutionWithInputParameters(varSolutionURI, _
    varInputParams)
XDocument NewFromSolutionWithInputParameters(
    Object varSolutionURI,
    Object varInputParams
)

Parameters

  • varSolutionURI
    Type: System.Object

    The Uniform Resource Identifier (URI) of the form template on which to base the new form.

  • varInputParams
    Type: System.Object

    One or more name/value pairs separated by the ampersand (&) character.

Return value

Type: Microsoft.Office.Interop.InfoPath.XDocument
An object that represents the new form.

Remarks

To use the input parameters passed to the inputParameters parameter, the form specified in the formTemplateLocation parameter must contain a Loading event handler that uses the InputParameters property of the LoadingEventArgs class to retrieve the input parameter values, and then do something with those values. For an example of how to do this, see the InputParameters property of the LoadingEventArgs class.

Examples

Note

The following example assumes that the Microsoft.Office.Interop.InfoPath namespace is being used and that the Microsoft InfoPath 3.0 Type Library is referenced.

The following example shows how to create a new form by passing in the URI of a form template that contains an appropriate Loading event handler and two input parameters.

XDocument newDocument;

// Create an InfoPath form passing in input parameters.
newDocument = thisApplication.XDocuments.NewFromSolutionWithInputParameters(
   @"C:\User Forms\DeptReport.xsn","Dept=Accounting&Acct=Contoso");
}

See also

Reference

XDocuments3 interface

XDocuments3 members

Microsoft.Office.Interop.InfoPath namespace