Training
Module
Introduction to Office client customization with add-ins - Training
Learn how to customize and extend Office applications including Word, Excel, and Outlook with Office Add-ins
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
You can use the ServerDocument
class in the Visual Studio Tools for Office runtime to manage several aspects of document-level customizations, even if Microsoft Office Word and Microsoft Office Excel are not installed. You can perform the following tasks:
Access and modify data in the data cache of a document or workbook. For more information, see Work with cached data in the document.
Manage the customization assembly that is associated with a document. For more information, see Manage the document customization.
Applies to: The information in this topic applies to document-level projects for Excel and Word. For more information, see Features available by Office application and project type.
The ServerDocument
class is designed to be used on computers that do not have Office installed. Therefore, you typically use this class in applications that do not integrate with Office, such as Console projects or Windows Forms projects, rather than Office projects. Use the ServerDocument class in the Microsoft.VisualStudio.Tools.Applications.ServerDocument.dll assembly.
The ServerDocument
class can be used to operate on document-level customizations that were created by using Visual Studio 2013.
For more information about the Visual Studio 2010 Tools for Office Runtime and the Office extensions for the .NET Framework, see Visual Studio Tools for Office runtime overview.
Note
If you have a legacy application that uses the ServerDocument
class in the Visual Studio Tools for Office
system (version 3.0 Runtime), the Visual Studio Tools for Office
system (version 3.0 runtime) must be installed on computers that run the application. The Visual Studio 2010 Tools for Office runtime
cannot run these applications.
The ServerDocument
class provides members you can use to work with the data cache in customized documents. For more information about cached data, see Cache data and Access data in documents on the server.
The following table lists the members you can use to work with cached data.
Task | Member to use |
---|---|
To determine whether a document has a data cache. | The IsCacheEnabled method. |
To access the cached data in a document. For more information, see Access data in documents on the server. |
The CachedData property. |
You can use members of the ServerDocument
class to manage the customization assembly that is associated with a document. For example, you can programmatically remove the customization from a document so that the document is no longer part of a customization.
The following table lists the members you can use to manage the customization assembly.
Task | Member to use |
---|---|
To determine whether a document is part of a document-level customization. | The GetCustomizationVersion method. |
To programmatically attach a customization to a document at run time. For more information, see How to: Attach managed code extensions to documents |
One of the AddCustomization methods. |
To programmatically remove a customization from a document at run time. For more information, see How to: Remove managed code Extensions from documents. |
The RemoveCustomization method. |
To get the URL of the deployment manifest that is associated with the document. | The DeploymentManifestUrl property. |
Training
Module
Introduction to Office client customization with add-ins - Training
Learn how to customize and extend Office applications including Word, Excel, and Outlook with Office Add-ins
Documentation
Properties in Office projects - Visual Studio (Windows)
Learn about the properties that are available to Office projects in Visual Studio through the Properties window.
Architecture of document-Level customizations - Visual Studio (Windows)
Learn about aspects of document-level customizations, including customization components and how customizations work with Microsoft Office applications.
Program document-level customizations - Visual Studio (Windows)
Learn how to extend Microsoft Word or Excel by using a document-level customization so you can perform various tasks.