Partilhar via


Deploy custom templates in Microsoft Office.

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: https://technet.microsoft.com/en-us/library/cc178976(office.12).aspx

 

 

Word 2010: https://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

  • Anonymous
    January 01, 2003
    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

  • Anonymous
    January 01, 2003
    Hey, I build a new GPO to fix the Problem:

I Specified the network folders with the templates to be offline available. (NotebookUser) GPO-Path: User ConfigurationPoliciesAdministrative TemplatesNetworkOffline Files \Serversharetemplates (DFS-Links work as well) 2. Delete: HKEY_CURRENT_USERSoftwareMicrosoftOffice14.0CommonSpotlightContent [YourCompany] Create: HKEY_CURRENT_USERSoftwareMicrosoftOffice14.0CommonSpotlightProviders [YourCompany] GPO-Path: User ConfigurationPreferencesWindows SettingsRegistry Conclusion: Now all templates are offline available and synced by Windows automatically. Every time a User gets a gpupdate the registry string ...Office14.0CommonSpotlightContent [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

  • Anonymous
    January 01, 2003
    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

  • Anonymous
    January 01, 2003
    Hey Thomas,

    Yes, you will need to use multiple xml files with different lcid codes. Basically 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.

    -Brandon

  • Anonymous
    January 01, 2003
    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

  • Anonymous
    January 01, 2003
    What happens when you try to create the registry settings?

    You specify the provider name in the registry like the following article mentions. Because the name is specified in the registry, I don't think there is a need to specify in the xml file because the registry is essentially pointing to the xml file, so the application will get the name from the registry.

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

  • Anonymous
    January 01, 2003
    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

  • Anonymous
    January 01, 2003
    Hi Bob, Is there a difference in the source address specified in the xml for the templates? Brandon

  • Anonymous
    January 01, 2003
    @baab123456 - I tested on my machine and Word displays them in alphabetical order by template filename. I can adjust the order in the xml file and it doesn't change the ordering in Word, they still show alphabetical order. What is the filename and order you are seeing in Word?

    @Patrick Hoban - I don't think that is possible with this Custom Templates feature.

  • Anonymous
    January 01, 2003
    I think both questions depend on what you mean by "everything". In the context of this blog, there are really two things, the xml files and the templates. The application should cache the visual UI pieces until the enddate is hit, so that would still be visible in the File menu. However, if the templates are no longer accessible, the UI doesn't really serve much purpose.

    You probably shouldn't be installing any Office application to a network drive, so assuming that is still local to the machine, they should still be able to use Word.

    It sounds like these are smaller questions to a specific scenario you are trying to address. If you could provide some specifics of the scenario or expand on "everything" I can try to give more guidance, but this is all I can think of right now with the given information. Hope it helps!

    -Brandon

  • Anonymous
    January 01, 2003
    @Brandon - Thank you.

  • Anonymous
    January 01, 2003
    Anyway to add an image on the "Contoso" folder instead of it being a folder image?

  • Anonymous
    January 01, 2003
    Hey Jon,

    In your scenario, as far as I know Office will only display the templates for English and that is expected even if you have both languages enabled. Only the currently active language config will be used to populate the templates. The folders will be there, but no content is going to be added for non-active languages.

    I guess you could technically get both to show up, but you would have to use the English config and add the French templates to it. If you use some kind of naming structure at the beginning of the template name like "[ENG]" or "[FRE]" so the users know which template they are using, it might get close to what you are looking for. I don't know of a way to directly do that using two different language config files though.

    -Brandon

  • Anonymous
    January 01, 2003
    Yes, the xml schema allows a value of 0.

  • Anonymous
    January 01, 2003
    Anyone else notice the templates are not displaying in alphabetical order within word?
    I've checked my xml file it is in alphabetical order so I'm confused as to how word is ordering the templates.

  • Anonymous
    August 13, 2012
    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!

  • Anonymous
    November 19, 2012
    Hi there, is there any way to avoid the "Contoso" folder in the "custom templates" section and directly show the templates there? Matt

  • Anonymous
    March 05, 2013
    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

  • Anonymous
    November 08, 2013
    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

  • Anonymous
    November 25, 2013
    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.

  • Anonymous
    November 25, 2013
    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
  • Anonymous
    March 14, 2014
    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
  • Anonymous
    July 28, 2014
    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?
  • Anonymous
    July 28, 2014
    Disregard that last comment.. I read through the whole article again and figured it out.

    Thanks again Brandon!
  • Anonymous
    September 01, 2014
    Great article, but if you have 2 or 3 different language versions of office 2010, should i make 3 xml files, with different lcid language codes, for it to work, or is there a workraound ?
  • Anonymous
    November 05, 2014
    The comment has been removed
  • Anonymous
    February 04, 2015
    Seriously???????????
    why do you destroy offices capabilities like
    Default template location. browse

    What i wrong with you microsoft people? Like win 8 , you just make programs worse and worse AND charge for it?

    Sick of it
  • Anonymous
    March 11, 2015
    I've created an xml file for each language. Is it possible to get both languages to show up? if my workstation is English, I still want to be able to choose a French template even though Office is currently set to English. But it shows up empty even though both languages are installed in Office.
  • Anonymous
    March 11, 2015
    Thanks for the quick reply Brandon. We were thinking of something along those lines.

  • Anonymous
    March 18, 2015
    Hi, just to check if everything is being saved via network folders, what would happen if the network is down and the users could not access the network anymore? Would they still be able to use MS word?
  • Anonymous
    March 24, 2015
    Can we use LCID=0 in our multilanguage environment (http://support.microsoft.com/en-us/kb/221435) ?
  • Anonymous
    June 08, 2015
    Hi,
    Is there any way to construct this so that you have a provider (ex. Company A) folder on the backstage, and within that folder there are additional folders (ex. Commercial, Non-Commercial). Basically, any way to nest the templates?

    Thanks,
    Doug
  • Anonymous
    October 01, 2015
    I also have noticed that the word files are not in alphabetical order. When I inspect the registry under "HKEY_CURRENT_USERSoftwareMicrosoftOffice12.0CommonSpotlightContent" the order of the folders is (1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20 etc...) I can change these manually in the registry by adding (01, 02, 03, etc..) and it will correct it, but I'm deploying this office-wide, and hope there is a solution so that it works without changing things after it deploys.

    I re-read this article and looked at my .xml file and don't see anything wrong. In theory everything is working as expected until the cache folder content creates and stores the template information.

    Any suggestions would be greatly appreciated.
  • Anonymous
    October 13, 2015
    @DougC - I'm not aware of a way to create a nested folder structure
  • Anonymous
    October 13, 2015
    @cshaper - I've seen the order do both alphabetical and base it on the order of the xml file. I haven't spent a lot of time investigating the ordering so maybe there is an issue that I'm not aware of yet. If you manually put the templates in alphabetical order in the xml file, delete your cache and restart Word, do they display in alphabetical order?
  • Anonymous
    October 27, 2015
    @Brandon De - The templates are in alphabetical order in the xml file. I deleted the cache and restarted word, and nothing changed. I tried adding the 01, 02, etc... to the template file names, and to the <o:featuredtemplate title=" in the xml file. That did not work either it would update the title name in word but the registry under content would still list the templates in (1, 10, 11, etc..).

    I seen a similar problem posted on social.technet with the title "Word 2010 custom template order? but there was no solution found and the only help just referenced this webpage and the other one listed in this article. I will post this question to that forum. Thank you for your suggestions.