Show All

# RegisterSolution Method (ExternalApplication Object)

Installs the specified Microsoft Office InfoPath 2003 form template.

expression.RegisterSolution(ByVal bstrSolutionURL As String, [ByVal bstrBehavior As String = "overwrite"])

expression Required. An expression that returns a reference to the ExternalApplication object.

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.

## Security Level

3: Can be accessed only by fully trusted forms.

## 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.

## 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:

    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

©2003-2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp