RegisterSolution Method
Collapse the table of content
Expand the table of content
This documentation is archived and is not being maintained.

Application.RegisterSolution Method

Office 2007
Installs the specified Microsoft Office InfoPath form template.

Version Information
 Version Added:  InfoPath 2003


expression.RegisterSolution(bstrSolutionURL, bstrBehavior)

expression   An expression that returns a Application object.


NameRequired/OptionalData TypeDescription
bstrSolutionURLRequiredStringThe string 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.
bstrBehaviorOptionalStringDefault value is "overwrite". The string that specifies how the form template is to be installed. The only other valid value for this parameter is "new-only".

Return Value


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.

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


In the following Visual Basic for Applications (VBA) example, the RegisterSolution method of the Application object is used to install a form template:

Visual Basic for Applications
Public Sub InstallForm()

   Dim objIP As Object

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

   ' 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

© 2016 Microsoft