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.
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.
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.
- 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.
- 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.