_ExternalApplication.NewFromSolution method
Creates a new Microsoft InfoPath form based on the specified form template.
Namespace: Microsoft.Office.Interop.InfoPath
Assembly: Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.dll)
Syntax
'Declaration
Sub NewFromSolution ( _
bstrSolutionURI As String _
)
'Usage
Dim instance As _ExternalApplication
Dim bstrSolutionURI As String
instance.NewFromSolution(bstrSolutionURI)
void NewFromSolution(
string bstrSolutionURI
)
Parameters
bstrSolutionURI
Type: System.StringThe string value that specifies the Uniform Resource Identifier (URI) of a form template.
Remarks
The NewFromSolution method can be used only to create a new form based on an existing form template; it cannot be used to create a new form based on an existing form. To create a form from an existing form, use New.
When you use The NewFromSolution method, InfoPath is opened and the new form is ready to be filled out.
Note
You cannot use Close to close a form that has been opened with the NewFromSolution method. When the NewFromSolution method creates a form, the name of that form is not yet known.
Examples
In the following example, which is written in the C# programming language, the NewFromSolution method of the ExternalApplication object is used to create a new form based on a specified form template:
private void CreateFromFormTemplate()
{
ExternalApplication infoPath = new ExternalApplicationClass();
// Create an InfoPath form.
infoPath.NewFromSolution(@"C:\My Forms\MyFormTemplate.xsn", 1);
}
Note
The above example assumes that the Microsoft.Office.Interop.InfoPath namespace is being used and that the Microsoft InfoPath 3.0 Type Library is referenced.