Edit

Share via


_ExternalApplication2.RegisterSolution(String, String) Method

Definition

Installs the specified form template.

public:
 void RegisterSolution(System::String ^ bstrSolutionURL, System::String ^ bstrBehavior);
public void RegisterSolution (string bstrSolutionURL, string bstrBehavior);
abstract member RegisterSolution : string * string -> unit
Public Sub RegisterSolution (bstrSolutionURL As String, bstrBehavior As String)

Parameters

bstrSolutionURL
String

Specifies the Uniform Resource Locator (URL) of the form template. This parameter can be specified as a form definition (.xsf) file or a form template (.xsn) file.

bstrBehavior
String

Default value is overwrite. Specifies how the form template is to be installed. The only other valid value for this parameter is new-only.

Implements

Examples

In the following example, which is written in the C# programming language, the RegisterSolution method of the ExternalApplication object is used to install a form template:

private void InstallForm()
{
 ExternalApplication infoPath = new ExternalApplicationClass();

 // Create an InfoPath form.
 infoPath.<span class="label">RegisterSolution</span>(@"C:\My Forms\MyFormTemplate.xsn", "overwrite");
}

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 RegisterSolution method of the ExternalApplication object is used to install a form template:

private void InstallForm()
{
 ExternalApplication infoPath = new ExternalApplicationClass();

 // Create an InfoPath form.
 infoPath.<span class="label">RegisterSolution</span>(@"C:\My Forms\MyFormTemplate.xsn", "overwrite");
}

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

If the form template has already been registered, and the new-only value is used for the bstrBehavior parameter, the RegisterSolution method will return an error. If the overwrite value is used, the form template's registration record will be overwritten.

Important: This member can be accessed only by forms opened from a form template that has been configured to run with full trust using the Security and Trust category of the Form Options dialog box. This member requires full trust for the immediate caller and cannot be used by partially trusted code. For more information, see "Using Libraries from Partially Trusted Code" on MSDN.

Applies to