_Application3.UnregisterSolution(String) Method

Definition

Uninstalls the specified form template.

public:
 void UnregisterSolution(System::String ^ bstrSolutionURI);
public void UnregisterSolution (string bstrSolutionURI);
abstract member UnregisterSolution : string -> unit
Public Sub UnregisterSolution (bstrSolutionURI As String)

Parameters

bstrSolutionURI
String

Specifies the Uniform Resource Identifier (URI) of the form template.

Implements

Examples

In the following example, the UnregisterSolution method of the Application object is used to uninstall a form template:

public void UninstallForm()
{
   Microsoft.Office.Interop.InfoPath.Application infoPath =
      new Microsoft.Office.Interop.InfoPath.ApplicationClass();
   infoPath.<span class="label">UnregisterSolution</span>(@"C:\My Forms\MyFormTemplate.xsn");
}

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 example, the UnregisterSolution method of the Application object is used to uninstall a form template:

public void UninstallForm()
{
   Microsoft.Office.Interop.InfoPath.Application infoPath =
      new Microsoft.Office.Interop.InfoPath.ApplicationClass();
   infoPath.<span class="label">UnregisterSolution</span>(@"C:\My Forms\MyFormTemplate.xsn");
}

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 cannot be unregistered, the UnregisterSolution method will return an error.

Important: This member can be accessed only by forms opened from a form template that has been configured to run with full trust using the Security and Trust category of the Form Options dialog box. This member requires full trust for the immediate caller and cannot be used by partially trusted code. For more information, see "Using Libraries from Partially Trusted Code" on MSDN.

Applies to