Upravit

Sdílet prostřednictvím


_Application3.RegisterSolution(String, String) Method

Definition

Installs the specified Microsoft Office InfoPath form template.

public void RegisterSolution (string bstrSolutionURL, string bstrBehavior = "overwrite");
abstract member RegisterSolution : string * string -> unit
Public Sub RegisterSolution (bstrSolutionURL As String, Optional bstrBehavior As String = "overwrite")

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

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

Implements

Examples

In the following C# example, the RegisterSolution method of the Application object is used to install a form template:

public void InstallForm()
{
   Microsoft.Office.Interop.InfoPath.Application infoPath = 
      new Microsoft.Office.Interop.InfoPath.ApplicationClass();
   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 C# example, the RegisterSolution method of the Application object is used to install a form template:

public void InstallForm()
{
   Microsoft.Office.Interop.InfoPath.Application infoPath = 
      new Microsoft.Office.Interop.InfoPath.ApplicationClass();
   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 "new-only" is specified for the bstrBehavior parameter, the RegisterSolution method will return an error. If "overwrite" is specified, the form template's registration record will be overwritten.

Applies to