XDocuments3.NewFromSolutionWithInputParameters(Object, Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a new form using the specified form template with the specified form template and input parameters
public:
Microsoft::Office::Interop::InfoPath::XDocument ^ NewFromSolutionWithInputParameters(System::Object ^ varSolutionURI, System::Object ^ varInputParams);
public Microsoft.Office.Interop.InfoPath.XDocument NewFromSolutionWithInputParameters (object varSolutionURI, object varInputParams);
abstract member NewFromSolutionWithInputParameters : obj * obj -> Microsoft.Office.Interop.InfoPath.XDocument
Public Function NewFromSolutionWithInputParameters (varSolutionURI As Object, varInputParams As Object) As XDocument
Parameters
- varSolutionURI
- Object
The Uniform Resource Identifier (URI) of the form template on which to base the new form.
- varInputParams
- Object
One or more name/value pairs separated by the ampersand (&) character.
Returns
An object that represents the new form.
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.<span class="label">NewFromSolutionWithInputParameters</span>(
@"C:\User Forms\DeptReport.xsn","Dept=Accounting&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.