Deploy custom templates in Microsoft Office.

Deploy custom templates in Microsoft Office.

  • Comments 17
  • Likes

When it comes to creating Word documents, everything starts with the template.  You cannot create a document without one and even though the Word application does provide users with many different templates to use by default, there are many scenarios where custom templates will need to be used. 

Since many people create their own set of templates, they also like the idea of having these templates show up in the interface of Word so that it is easier for users to find and create documents.  It is possible to add your own set of custom templates to the interface of Word and the links below will provide you with the information necessary to create and deploy these templates.  The purpose of this blog post is to provide some supplemental information regarding that particular TechNet article to address a couple common questions that get asked while setting up this behavior.

Note: These templates should look the same in all Office apps that take advantage of this functionality.   For the context of this blog post though, I am going to be specifically talking about the Microsoft Word application.

 

Word 2007: http://technet.microsoft.com/en-us/library/cc178976(office.12).aspx

 

 

Word 2010: http://technet.microsoft.com/en-us/library/cc178976.aspx

 

 

At this point, assuming you have successfully deployed the custom templates per the TechNet article, you should now have something similar to the above screenshots.  You should also notice that the registry contains some changes that you did not make.  In the article, the only changes in the registry were to one of the following locations.

  • Word 2007 - HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\Spotlight\Providers
  • Word 2010 - HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\Spotlight\Providers

However, if you went through the article correctly and have opened Word to verify that templates do indeed display as expected, you will notice another registry key value that was created at the following location.

HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\Spotlight\Content

This location in the registry is a cache of the information from the custom xml file you created.  Word will use these values and even though they are not technically required, they are necessary because if you delete the Provider (for this example it's Contoso) under the Content hive, Office will recreate the key the next time an Office application launches.

One of the common questions we get regarding these custom template is about the "startdate" and "enddate" registry keys.  These values are from the xml file you created and are added to the cache.  When an Office application opens, it checks these registry values for each provider and depending on what the current day is, decides if it should display the templates.

With the "startdate" key, Office will only display the templates if this value is in the past or equals the current day.  The "enddate" value is also checked and if the value is a date in the future, the application does nothing and displays the same information from the cache.  If the "enddate" is a value less than or equal to the current day however, it does not display the templates.

Where this can cause concerns is when changes are made to the xml file that was initially created but the "enddate" is still in the future.  The problem is that these changes will not get updated in the display for Word, because it will only check for updates to the xml if the "enddate" value is a date in the past. 

This brings us to the other common question we get about this feature.  How can the templates/display be updated?  As far as I can tell, there are only two possible workarounds for updating the content. 

  1. If you know you will be making continuous changes, you could set the "enddate" to a value that is not very far in the future.  Then each time you update your xml file, push the date out a little bit farther. 
  2. When you push out changes to the xml, you can also delete the cached provider key and Office should retrieve the new xml and update the cache the next time Word is launched.
Comments
  • Hi,

    thanks for this great article!

    but is there no other way to Update, Add or Remove Templates via the xml-file?

    Do you no an other (better, more flexible) method to deploy Office templates in a company?

    Best regards

    Max

  • Hey Max,

    Thanks, hopefully you found this helpful.  

    If you want the templates to show up directly in the backstage / Office button menu, then using this type of approach to update via xml is the only way I've come across.

    However, If you want to just use templates in general, you can still save them to any location (local or on a network share) and the user can create new documents from those templates like any other version of Word.  

    There are ways of managing these templates in a company like using group policy and if you do a search you should find different methods that might be more flexible for your scenario.  The following links are just a couple examples, but there are many others that could provide you some useful information.

    support.microsoft.com/.../924460

    support.microsoft.com/.../890294

    Brandon

  • Hey,

    I build a new GPO to fix the Problem:

    1.

    I Specified the network folders with the templates to be offline available. (NotebookUser)

    GPO-Path:

    User Configuration\Policies\Administrative Templates\Network\Offline Files

    \\Server\share\templates\

    (DFS-Links work as well)

    2.

    Delete:

    HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\Spotlight\Content\ [YourCompany]

    Create:

    HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\Spotlight\Providers\ [YourCompany]

    GPO-Path:

    User Configuration\Preferences\Windows Settings\Registry

    Conclusion:

    Now all templates are offline available and synced by Windows automatically.

    Every time a User gets a gpupdate the registry string ...Office\14.0\Common\Spotlight\Content\ [YourCompany] will be deleted and when he wants to open a template it will be recreated with the latest template.xml file. So he is (almost) always up to date.

    Max

  • Hello and thanks for the great article,

    We are using Mui-version of the Office 2010 and we should be able to deploy templates to all language versions installed.. there is the LCID-attribute at the configuration xml-file and if I have understood correctly only one language can be selected.. have you any workaround for this problem?

    Regards, Tim!

  • Hey Tim,

    You're welcome.  I'm glad you found it helpful.  

    You are correct that only one language can be used in the config file.  To get multiple languages to work, you need to create a different "provider" for each language that will be used.  So if you had 1 provider called "Contoso", you would need to create two registry entries, one for each language.  "Contoso (English)" and "Contoso (French)" for example and you will also need to have 2 separate xml files for each language.  The caveat is that both providers will be displayed in the UI, but only the templates for the current Office language will be displayed.  

    It's definately not the best workaround, but it's the only way I've been able to come up with for this scenario.  Sorry about the hassle with this situation and hopefully this helps in some way.

    Brandon

  • Hi there,

    is there any way to avoid the "Contoso" folder in the "custom templates" section and directly show the templates there?

    Matt

  • I am having an issue with xml file I can only see one temp the rest of temp I am not able ot see any help pleas

  • Hey Matt,

    Sorry about the delay.  As far as I know, you must have a provider specified so there will always be a folder like "Contoso" in the section.

    Brandon

  • Hi Bob,

    Is there a difference in the source address specified in the xml for the templates?

    Brandon

  • I'm having an issue, I can see the folder in the Custom templates but is is empty. I don't understand why ! Can you please help me ? Thanks

  • Hey everybody, thanks for this great tutorial.

    I have the same problem as Fred. I see an empty folder in the "custom templates" area and have no idea what's wrong. I specified the provider in the registry, took the path to the xml as the "ServiceURL" value but there's still the empty folder. I guess it's because of the 'enddate', but I don't really understand what this attribute means.

  • Hey Fred and Andi,

    I'm not sure what would be causing the empty folders.  That is not an issue I have seen before and troubleshooting these types of issues will be difficult through blog comments.  It might be better to try submitting your problem through one of the following avenues.

    1. Try the free public answers forum located here: answers.microsoft.com/.../word

    2. You can contact Microsoft Product Support directly to discuss additional support options you may have available, by contacting us at 1-(800)936-5800 or by choosing one of the options listed at

    support.microsoft.com/.../international.aspx

    If you are a MSDN [TechNet] subscriber, you can also contact our support by using your free support incidents: msdn2.microsoft.com/.../aa948874.aspx

    -Brandon

  • The cause for the empty Folders is often the false use of "lcid". E.g. "1033" is for English (U.S.), "1031" is for Germany.

    Andi

  • Brandon - Thanks so much for this article. I need some clarification on the last paragraph though.

    You state the only way to update the templates once pushed out is to set the end date and delete the cached provider key.. Where would I find the cached provider key and how can I delete it? Also, if I set the end date to a date and that date passes without updating the XML file, what happens?

  • Disregard that last comment.. I read through the whole article again and figured it out.

    Thanks again Brandon!

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment