How to: Publish Template Solutions That Run Code on a Network
Template solutions are built with a relative path to the customization, unless you take steps to change the path. If the customization is stored in a network location, you must change a custom document property to include a full path to the deployment manifest on the network.
Applies to: The information in this topic applies to document-level projects for the following applications: Excel 2007 and Excel 2010; Word 2007 and Word 2010. For more information, see Features Available by Office Application and Project Type.
You can update the custom document properties in several ways, including the following:
Use the Publish Wizard to publish your solution.
Change the properties in the Word or Excel application user interface (UI).
Change the path in the Setup program.
Use the API that is described in the Open XML Format SDK.
Use the Publish Wizard to publish the solution and automatically update the deployment manifest path in the document.
To specify the full path by using the Publish Wizard
On the Build menu, click Publish SolutionName.
The Publish Wizard starts.
Follow the steps in the wizard to publish the solution.
On the second page of the wizard, set the default installation path to the shared folder location.
For more information, see How to: Publish an Office Solution by Using ClickOnce.
You can update custom document properties in the application UI.
To change the property values in the application UI
Copy the solution files from the build output folder to a shared folder on the network.
Open the solution document that you plan to deploy to your users.
Click the File tab (for Excel 2010 or Word 2010) or the Microsoft Office Button (for Excel 2007 or Word 2007), point to Prepare, and then click Properties.
Click Document Properties, and then click Advanced Properties.
On the Custom tab, in the Properties list, select _AssemblyLocation.
In the Value box, there is a deployment manifest identifier already present. At the beginning of the identifier, type the fully qualified path of the deployment manifest followed by a bar, in the format path|identifier.
As an example, the path could look like this:
For more information about how to format this identifier, see Custom Document Properties Overview.
Click OK, and then save and close the document.
You can modify the installation path in the Setup program from the Command Prompt window, without using Visual Studio. When the installer runs, it uses the updated value. For more information, see How to: Change the Installation Path of an Office Solution.
Documents in the 2007 Microsoft Office system use the Open XML Format as the default file format. You can manipulate Open XML files by using the API.
To access custom document properties by using the API
Use the CustomFilePropertiesPart class to access the custom document properties and change the value.
For an example of using the Open XML Format API, see the MSDN technical article Manipulating Word 2007 Files with the Open XML Object Model (Part 2 of 3).