_ExternalApplication2.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
Sub NewFromSolutionWithInputParameters ( _
    bstrSolutionURI As String, _
    bstrInputParameters As String _
)
'Usage
Dim instance As _ExternalApplication2
Dim bstrSolutionURI As String
Dim bstrInputParameters As String

instance.NewFromSolutionWithInputParameters(bstrSolutionURI, _
    bstrInputParameters)
void NewFromSolutionWithInputParameters(
    string bstrSolutionURI,
    string bstrInputParameters
)

Parameters

  • bstrSolutionURI
    Type: System.String

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

  • bstrInputParameters
    Type: System.String

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

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.

private void CreateFormWithInputParameters()
{
ExternalApplication infoPath = new ExternalApplicationClass();

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

See also

Reference

_ExternalApplication2 interface

_ExternalApplication2 members

Microsoft.Office.Interop.InfoPath namespace