Document.RemoveCustomization Method

Removes the customization from the document.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

Syntax

'Declaration
Sub RemoveCustomization
void RemoveCustomization()

Exceptions

Exception Condition
CannotRemoveCustomizationException

The custom document properties or the cached data could not be removed from the document.

UnauthorizedAccessException

The document is protected.

Remarks

This method removes the customization by performing the following tasks:

  • It deletes the _AssemblyName and _AssemblyLocation custom properties from the document. For more information, see Custom Document Properties Overview.

  • It deletes the cached data from the document. For more information about cached data, see Caching Data.

This method might throw an UnauthorizedAccessException if the document is protected. You should remove any protection from the document before calling this method.

.NET Framework Security

See Also

Reference

Document Interface

Microsoft.Office.Tools.Word Namespace

Other Resources

How to: Remove Managed Code Extensions from Documents

Custom Document Properties Overview

Caching Data