Edit

Share via


_ExternalApplication2.NewFromSolutionWithInputParameters Method

Definition

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

public:
 void NewFromSolutionWithInputParameters(System::String ^ bstrSolutionURI, System::String ^ bstrInputParameters);
public void NewFromSolutionWithInputParameters (string bstrSolutionURI, string bstrInputParameters);
abstract member NewFromSolutionWithInputParameters : string * string -> unit
Public Sub NewFromSolutionWithInputParameters (bstrSolutionURI As String, bstrInputParameters As String)

Parameters

bstrSolutionURI
String

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

bstrInputParameters
String

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

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. <span class="label">NewFromSolutionWithInputParameters</span>(
   @"C:\User Forms\DeptReport.xsn","Dept=Accounting&amp;Acct=Contoso");
}

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. <span class="label">NewFromSolutionWithInputParameters</span>(
   @"C:\User Forms\DeptReport.xsn","Dept=Accounting&amp;Acct=Contoso");
}

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.

Applies to