UnregisterSolution Method (ExternalApplication Object)

Microsoft Office InfoPath

Uninstalls the specified Microsoft Office InfoPath 2003 form template.

expression.UnregisterSolution(ByVal bstrSolutionURI As String)

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

bstrSolutionURI Required String. The string value that specifies the Uniform Resource Identifier (URI) of the form template.

Security Level

3: Can be accessed only by fully trusted forms.

Remarks

If the form template cannot be unregistered, the UnregisterSolution method will return an error.

Example

In the following example, which is written in the Visual Basic for Applications (VBA) programming language, the UnregisterSolution method of the ExternalApplication object is used to uninstall a form template:

Public Sub UninstallForm()

   Dim objIP As Object

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

   'Unregister the InfoPath form template.
   objIP.UnregisterSolution ("C:\\My Forms\\MyFormTemplate.xsn")
   MsgBox ("The InfoPath form template has been unregistered.")

   Set objIP = Nothing

End Sub