Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

How to: Update Deployed Office Documents That Use Managed Code Extensions

Note Required applications

The features in this topic are available only if you have the required applications installed.

For more information, see Features Available by Product Combination.

  • One of these development environments:

    VSTO 2005

    -or-

    Visual Studio Team System

  • Microsoft Office 2003

If a solution document, template, or workbook has been deployed to each end user and the solution assembly is in a network location, the document cannot easily be updated automatically. However, you can use the procedures outlined in this topic to provide automatic notification to end users that the current Office document is outdated, and that they must get a newer version.

The basic steps are:

  1. Create a new Microsoft Office Word 2003 or Microsoft Office Excel 2003 application project based on the document that has been updated. The assembly from this project will be used to provide notification to users that they must get the updated document.

  2. Move the assembly that is currently in use to a new location, and put the notification assembly in the original location.

  3. Point the updated document to the new project assembly location.

If you do not want to completely prevent users from working with the outdated solution, you can call the notification using the Startup event of your existing solution. This reminds users to update every time they open the document.

To create a new project based on an updated document

  1. Make the required revisions to a copy of the existing document, template, or workbook.

  2. In Visual Studio, create a new Word or Excel application project of the same type as your existing solution.

    You will use the assembly in this project as a notification assembly, to replace the project assembly that the outdated Office document points to.

  3. In the Visual Studio Tools for Office Project Wizard, select Copy an existing document.

  4. Next to the Path to the existing document text box, click Browse and navigate to the updated document.

  5. Select the document, and then click Open.

  6. Click Finish to create the project based on the updated document.

To create a notification assembly

  1. In the Startup method of the new assembly (the notification assembly), write code to show a message box containing the information that the user needs to get the updated document. For example:

    System.Windows.Forms.MessageBox.Show("This document has been updated. "
        + "Please download a new version from the following location: "
        + @"\\ServerName\FolderName");
    
    
  2. Change the output name for the notification assembly using the project properties so that it has the same name as the project assembly used in your solution. Make sure that the notification assembly has the necessary evidence to be trusted by your deployed solution.

To replace the project assembly with the notification assembly

  1. Copy the project assembly that your solution uses to a new location, and grant it trust at the new location. For more information, see How to: Grant Permissions to Folders and Assemblies.

  2. Put the updated Office document in the new location, and copy the deployment and application manifests to the new location.

  3. Edit the new application manifest so that it points to the new deployment manifest and assembly. For more information, see Application Manifests for Office Solutions.

  4. Increase the version of the application manifest.

  5. Edit the new deployment manifest so that it points to the new application manifest. For more information, see Deployment Manifests for Office Solutions.

  6. Increase the version of the new deployment manifest.

  7. Update the application manifest that is embedded in the document to point to the new deployment manifest location. For more information, see How to: Change the Path to the Deployment Manifest Programmatically.

    Now the updated document and the assembly that it points to are ready to be used, as soon as the end users know where to get the updated document.

  8. Deploy the notification assembly to the old assembly location and remove the project assembly. The next time a user opens the outdated Office document, the notification assembly runs, and the user sees the message box that contains information on getting the latest document version.

See Also

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2015 Microsoft