CachedAttribute Class


Instructs the Visual Studio Tools for Office runtime to add the specified data object to the data cache in the document.

[System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.Field)]
public sealed class CachedAttribute : Attribute


This attribute can only be used in a document-level customization for Word or Excel created by using the Office development tools in Visual Studio.

To add an object to the data cache in a document, the object must have a public type that meets the requirements of XmlSerializer. For more information about adding objects to the data cache, see Caching Data. For more information about using attributes, see Attributes.

If you want to have greater control over the caching behavior of the data object, you can implement the ICachedType interface in the type of the object.



Initializes a new instance of the CachedAttribute class.

Applies to