Deploying Office Templates and Application-Specific Add-insThis content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
The Packaging Wizard is a good tool for building setup programs for many Microsoft® Office applications. However, Office templates and application-specific add-ins (versus COM add-ins) are exceptions, because they should be installed to special folders on a user's computer. The Packaging Wizard does not have the functionality to install to these special folders.
On a computer running Microsoft® Windows® without user profiles enabled, Office templates and add-ins should be installed to the following folders, respectively:
Otherwise, if user profiles are used, Office templates and add-ins should be installed to these folders:
If your operating system is Windows 98, Windows Me, or Microsoft® Windows NT® 4:
C:\WindowsFolder\Profiles\UserName\Application Data\Microsoft\Templates C:\WindowsFolder\Profiles\UserName\Application Data\Microsoft\Addins
If your operating system is Windows 2000 or later:
C:\Documents and Settings\UserName\Application Data\Microsoft\Templates C:\Documents and Settings\UserName\Application Data\Microsoft\Addins
Although it is not absolutely necessary to install a template or add-in to one of these folders, there are some advantages to doing so:
- If a Microsoft® Word, Microsoft® Excel, or Microsoft® PowerPoint® custom template is stored on users' computers, it must be installed to the Templates folder in order for it to appear in the New dialog box (File menu).
- Because the Templates and AddIns folders are the default folders for templates and add-ins, installing them there makes it easier for users to locate a template or add-in. For example, Excel add-ins (.xla files) that are installed in the AddIns folder automatically appear in the list of available add-ins in the Add-ins dialog box (Tools menu), so that users do not have to browse to find the correct file.
- The Templates and AddIns folders are trusted folders, meaning that an add-in or template in one of these folders does not have to be digitally signed by a trusted source in order to run code when security is set to High. These folders are trusted by default, but it's possible to override this setting by clearing the Trust all installed add-ins and templates check box on the Trusted Sources tab of the Security dialog box.
To open the Security dialog box in an Office application, point to Macro on the Tools menu, and then click Security. If you change the default folder for templates and add-ins, the new folder that you specify will be trusted.
There are simple ways to deploy templates and add-ins to the Templates and AddIns folders. You can use one of these strategies, or you can create your own simple custom installation program. For more information, see Deploying Application-Specific Add-ins.
What are User Profiles?
Microsoft Windows offers a user profiles feature. A user profile is an account maintained by the operating system that keeps track of a particular user's files and system configuration.
In Microsoft® Windows NT® Workstation, Windows NT Server, and Windows 2000, user profiles are automatically turned on all the time. Whenever a new user logs in, a user profile is created for that user. On Windows NT, the profile is created under the C:\Winnt\Profiles\UserName folder. On Windows 2000, it is created under C:\Documents and Settings\UserName. In other versions of Microsoft Windows, user profiles are optional.
When you log on to a computer as a user who has a user profile, Windows checks the data it has stored for that user profile, and loads with those settings in place. Additionally, it maintains a folder for files created under that user profile, the C:\Windows\Profiles\UserName folder.
Under any of the previously mentioned operating systems, the system can be secured so that each user has access only to the files, applications, and system configuration defined for his or her user profile. For example, files that are installed by a user who has administrative privileges might not be available to another user who does not share those privileges.
Deploying Custom Office Templates
When you create a new document in Microsoft Word, Microsoft Excel, or Microsoft PowerPoint, the New dialog box (File menu) displays a list of templates that you can choose from to create a new document. The dialog box can display three types of templates: built-in templates that are included with Microsoft Office; user-created templates, which are stored on users' computers; and workgroup templates, which are stored on a network share. Only templates from certain folders are displayed, however, so if you create a new template, you must save it to the correct location in order for it to be displayed in the dialog box. The following table indicates where the dialog box looks for each type of template.
|Type of template||Default location||Notes|
|The language ID is a number indicating the product language. For U.S. English, this is 1033. User-created templates saved here will not appear in the New dialog box.|
C:\Documents and Settings
|You can change this location in Word or Excel in the Options dialog box (Tools menu). In order to appear in the New dialog box, user-created templates must be stored in the location that is specified in the Options dialog box.|
|Workgroup||Not specified||You can specify a location for workgroup templates in the Options dialog box in Word, or from VBA code in Excel or Word. When you set this option, templates in the specified location appear in the New dialog box.|
As you can see, you have two options for installing a custom template: You can install it locally on users' computers, or you can copy it to a shared folder on a network server.
Local Installation of a Custom Template
To install a custom template locally onto users' computers, you have a couple of options:
- You can e-mail the template to users or instruct users to copy it from a network share, with instructions for where to copy the template to on the users' computers.
- You can create a custom installation program to copy the template to the correct folder.
Deployment of a Workgroup Template to a Network Share
If you must deploy a custom template to multiple users, a good way to do this is to copy the template to a shared folder on a network server, so that it is available to everyone who has access to the share.
When you have copied the template to the shared folder, you must make sure that every user has specified this path for workgroup templates. Word and Excel both provide an option to specify a path for workgroup templates. You or users can set this option to point to the shared folder for each user's application.
There are several ways to set the workgroup templates option:
- You can instruct each user to set it.
- You can write code to set the option and run the code on all users' computers.
- For custom Word templates, if the Normal.dot file is under administrative control, you can set the option there. In this scenario, the Normal.dot file is probably read-only, so users cannot modify the setting.
In Word, you can modify the workgroup templates option through Microsoft Visual Basic for Applications (VBA) code by setting the DefaultFilePath property of the Options object, passing in the wdWorkgroupTemplatesPath constant for the path argument, as shown in the following code fragment:
Options.DefaultFilePath(wdWorkgroupTemplatesPath) = "\\Server\Share\WorkgroupTemplates"
In Excel, you can modify the workgroup templates option through VBA code by setting the NetworkTemplatesPath property of the Application object:
Application.NetworkTemplatesPath = "\\Server\Share\WorkgroupTemplates"
For example, if you have Visual Basic, you can write a simple program that launches Word or Excel through Automation to set this option, and then compile the program into an .exe file and distribute it to all of the users through e-mail. When the users run the program, it will set the workgroup templates option correctly for them.
Storing a workgroup template on a common network share is a good idea from a maintenance standpoint, because you can modify the template without having to redistribute the template to every user. However, if you must deploy the template to users who do not have access to a common network share, you can build a custom installation program to deploy a template.