Share via


ExternalApplication.RegisterSolution Method

InfoPath Developer Reference

Installs the specified Microsoft Office InfoPath 2007 form template.

Version Information
 Version Added:  InfoPath 2003

Syntax

expression.RegisterSolution(bstrSolutionURL, bstrBehavior)

expression   An expression that returns a ExternalApplication object.

Parameters

Name Required/Optional Data Type Description
bstrSolutionURL Required String The string value that 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 Optional String Default value is overwrite. The string value that specifies how the form template is to be installed. The only other valid value for this parameter is new-only.

Return Value
Nothing

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.

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

Visual Basic for Applications
  Public Sub InstallForm()

Dim objIP As Object

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

'Register the InfoPath form template. objIP.RegisterSolution ("C:\My Forms\MyFormTemplate.xsn") MsgBox ("The InfoPath form template has been registered.")

Set objIP = Nothing

End Sub

See Also