Mananging Your Modified Templates

Eventually, once you modify the RibbonUI, you want to see the modified Ribbon every time you open Word or Excel. Hence, you would want to create templates that are loaded each time the application is launched. There are times, however, when you want certain macros to travel with just a particular document so that when you send the document to someone, they can see your modified Ribbon and have access to the macros. This piece will deal with handling RibbonUI modified in documents and in templates.


Word and Excel deal with templates differently. For Word, the default template is called Normal.dotm and its location is "%appdata%\Roaming\Microsoft\Templates\". The full location is "C:\Users\[profile name]\AppData\Roaming\Microsoft\Templates\" where C:\ is your system drive. If the template is not already there, then starting Word will create a default one. You can replace the default one with a custom one. You can actually name the template anything. However, only Normal.dotm placed in "%appdata%\Roaming\Microsoft\Templates\" will load at startup. If you call your template anything else, you will have to open it like a regular document.

For Excel, the default template is called Book.xltm and it has two locations: "C:\Program Files\Microsoft Office\Office12\XLSTART" and "%appdata%\Microsoft\Excel\XLSTART\". If you place the template in the Program Files branch, then it will be available to all. If you want user-level preference, then it's best to place in the %appdata% branch. Once you place a modified template here, your template will launch whenever Excel is started.


Ribbon Image

As I mentioned, it may be beneficial to have a modified Ribbon only for a particular document. When you send that document to someone else, they will see the modified Ribbon when opening. You can also "Save As" modified documents to save it as a template, such as Normal.dotm or Book.xltm and use it as a template to launch each time. If your template has a modified Ribbon with macros and you open a modified document with macros, then in VB editor, you will see your modules for the template and the document separately as projects. In the image on the right, you can see that Normal.dotm already has macros in the module Normal_Macros. CustomUI.docm was opened which also has macros in the module customUI_Macros.