Share via


ExternalApplication.NewFromSolution Method

InfoPath Developer Reference

Creates a new Microsoft Office InfoPath 2007 form based on the specified form template.

Version Information
 Version Added:  InfoPath 2003

Syntax

expression.NewFromSolution(bstrSolutionURI)

expression   An expression that returns a ExternalApplication object.

Parameters

Name Required/Optional Data Type Description
bstrSolutionURI Required String Required String. The string value that specifies the Uniform Resource Identifier (URI) of a form template.

Return Value
Nothing

Remarks

When you use the NewFromSolution method, InfoPath is opened and the new form is ready to be filled out.

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 the New method of the ExternalApplication object.

Bb229789.vs_note(en-us,office.12).gif  Note
You cannot use the Close method of the ExternalApplication object to close a from that has been opened with the NewFromSolution method. When the NewFromSolution method creates a form, the name of that form is not yet known.

Security Level 3: Can be accessed only by fully trusted forms.

Example

In the following example, which is written in the Visual Basic for Applications (VBA) programming language, the NewFromSolution method of the ExternalApplication object is used to create a new form based on a specified form template:

Visual Basic for Applications
  Public Sub CreateFromFormTemplate()

Dim objIP As Object

'Create a reference to the ExternalApplication object. Set objIP = CreateObject("InfoPath.ExternalApplication")

'Create an InfoPath form from a form template. objIP.NewFromSolution ("C:\My Forms\MyFormTemplate.xsn") MsgBox ("The InfoPath form has been created.")

Set objIP = Nothing

End Sub

See Also