ServerDocument::RemoveCustomization Method (String^)

 

Removes the customization from the document.

Namespace:   Microsoft.VisualStudio.Tools.Applications
Assembly:  Microsoft.VisualStudio.Tools.Applications.ServerDocument (in Microsoft.VisualStudio.Tools.Applications.ServerDocument.dll)

public:
static void RemoveCustomization(
	String^ documentPath
)

Parameters

documentPath
Type: System::String^

The full path of the document from which you want to remove the customization.

Exception Condition
ArgumentNullException

The documentPath parameter is null or empty or consists completely of white space characters.

FileNotFoundException

The file specified by documentPath does not exist.

IOException

The file specified by documentPath is read-only, or cannot be accessed.

InvalidOperationException

The file specified by documentPath does not have a customization, or an error occurred while loading the manifest.

DocumentCustomizedWithPreviousRuntimeException

The file specified by documentPath has a customization that was not created with the Visual Studio 2010 Tools for Office Runtime or the Visual Studio Tools for the Microsoft Office system (version 3.0 Runtime).

This method clears the deployment manifest URL and the cached data manifest, and removes any cached data from the document. For more information, see How to: Remove Managed Code Extensions from Documents.

The following code example uses the RemoveCustomization method to remove the customization from the specified document. The example first calls the GetCustomizationVersion method to determine whether the document has a customization.

This example requires:

  • A console application project or some other non-Office project.

  • References to the following assemblies:

    • Microsoft.VisualStudio.Tools.Applications.ServerDocument.dll and Microsoft.VisualStudio.Tools.Applications.Runtime.dll (if the project targets the .NET Framework 4 or the .NET Framework 4.5).

      or

    • Microsoft.VisualStudio.Tools.Applications.ServerDocument.v10.0.dll and Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0.dll (if the project targets the .NET Framework 3.5).

  • Imports (for Visual Basic) or using (for C#) statements for Microsoft.VisualStudio.Tools.Applications and Microsoft.VisualStudio.Tools.Applications.Runtime namespaces at the top of your code file.

No code example is currently available or this language may not be supported.
Return to top
Show: