_ExternalApplication.NewFromSolution(String) 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 Microsoft InfoPath form based on the specified form template.
public:
void NewFromSolution(System::String ^ bstrSolutionURI);
public void NewFromSolution (string bstrSolutionURI);
abstract member NewFromSolution : string -> unit
Public Sub NewFromSolution (bstrSolutionURI As String)
Parameters
- bstrSolutionURI
- String
The string value that specifies the Uniform Resource Identifier (URI) of a form template.
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.<span class="label">NewFromSolution</span>(@"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.
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.<span class="label">NewFromSolution</span>(@"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.
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(String, Int32).
When you use The NewFromSolution method, InfoPath is opened and the new form is ready to be filled out.
Note: You cannot use Close(String) 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.