Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
 ServerDocument Sample
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Microsoft Visual Studio Tools for the Microsoft Office system (version 3.0)
ServerDocument Sample

Updated: November 2007

Note:

This sample runs only in Microsoft Office Excel 2007 and Microsoft Office Word 2007.

This sample tool provides a graphical user interface and a command-line interface that enable you to view and modify a Visual Studio Tools for Office document's _AssemblyLocation property as described in Custom Document Properties Overview. This tool also enables you to view and modify data that is cached in the document.

The application manifest contains information that is used at run time or design time to describe the solution that is associated with a document. The application manifest is accessible through the ServerDocument object, which provides an API for working with the application manifest. This sample tool uses that API to enable you to view and modify the application manifest and data cached in a Visual Studio Tools for Office solution document.

Security Note:

This sample code is intended to illustrate a concept, and it shows only the code that is relevant to that concept. It may not meet the security requirements for a specific environment, and it should not be used exactly as shown. We recommend that you add security and error-handling code to make your projects more secure and robust. Microsoft provides this sample code "AS IS" with no warranties.

For information about how to install the sample project on your computer, see How to: Install and Use Sample Files Found in Help.

Download sample

To run this sample

  • Press F5.

To remove a customization from a document

  1. On the File menu, click Open, and then open a Visual Studio Tools for Office document-level customization that uses Microsoft Visual Studio Tools for the Microsoft Office system (version 3.0 Runtime).

  2. On the Edit menu, click Remove Customization.

To add a customization to a document

  1. On the File menu, click Open, and then open a document. The document does not have to be a Visual Studio Tools for Office solution document.

  2. On the Edit menu, click Add Customization.

  3. Enter the location of the deployment manifest URL and click OK.

To view cached data

  1. On the File menu, click Open, and then open a Visual Studio Tools for Office document-level customization that uses Microsoft Visual Studio Tools for the Microsoft Office system (version 3.0 Runtime).

  2. In the Cached Data panel, select an item in the tree view to display the data.

  3. You can make changes to the data and save the changes by clicking Save on the File menu.

To remove cached data

  1. On the File menu, click Open, and then open a Visual Studio Tools for Office solution document.

  2. On the Edit menu, click Remove Cached Data.

  3. On the File menu, click Save.

To use the command-line version

  1. Open the Command Prompt window.

  2. To view the options, type the following command.

    VSTOServerDocumentSample.exe /?
    
  • How to work with ServerDocument and associated objects.

  • How to view and manage cached data.

  • How to attach and remove a customization.

  • How to delete cached data.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker