Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

How to: Change the Path to the Deployment Manifest Programmatically

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

You can use the object model in the Microsoft Visual Studio 2005 Tools for the Microsoft Office System runtime to programmatically update the application manifest that is embedded in a document that is part of a document-level customization. Generally this is not necessary, because there is another model for updating manifests that involves modifying XML files that are generated by the Publish Wizard. For more information, see How to: Change the Location of Document-Level Customizations.

You must put the code for manipulating the object model in a new project (not your Visual Studio Tools for Office solution)—for example, in a console application or ASP.NET page. Visual Studio Tools for Office includes a sample that demonstrates how to create a tool that can be used to edit the embedded application manifest. For more information, see Application Manifest Editor Sample.

NoteNote

This topic does not apply to application-level add-ins, because they do not use embedded application manifests. To change the path to the deployment manifest of an add-in, use a text editor to update the application manifest that is on the client computer. For more information, see Application Manifests for Office Solutions. For more information about application-level add-ins and document-level customizations, see Office Solutions Architecture Overview.

To change the path to the deployment manifest programmatically

  1. Create a new project to change the manifest file in the Office document. This project can be of any type—for example, a command line solution.

  2. Add a reference to Microsoft.VisualStudio.Tools.Applications.Runtime to this project.

  3. Add an Imports or using statement for the runtime to the top of your code file:

    using Microsoft.VisualStudio.Tools.Applications.Runtime;
    
    
  4. Create an instance of ServerDocument, passing in the solution document, and then assign the new deployment manifest path to the DeployManifestPath property:

    ServerDocument sd = null;
    try
    {
        sd = new ServerDocument(@"C:\Documents\SolutionDocument.doc");
        sd.AppManifest.DeployManifestPath = 
            @"\\NewServer\ShareFolder\SolutionDocument.application";
    
    
  5. Save your changes and close the document:

        sd.Save();
    }
    finally
    {
        if (sd != null)
        {
            sd.Close();
        }
    }
    
    

See Also

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.