1
votes

I distribute a Word template with a large VBA code base in it. The template includes a menu, and for Word 2007/2010 users, a ribbon tab. In Word 2013, everything still works fine via the menu, but the ribbon is not showing up. I still code in VBA without using Visual Studio (and don't want to buy VSTO). So i'm trying to figure out how to update my ribbon code/xml or whatever it is I need to do to make my ribbon tab show up in 2013.

The ribbon is copied into a new document from the template when a user creates a new document based on the template. But something's going wrong with that process in Word 2013. Interestingly, if I open a document that was previously created from my template (in Word 2010), the ribbon displays and works fine. But if I create a new Word 2013 document from the template, the ribbon is not there.

There must be something I need to do in my code to tell Word to display the ribbon in new documents based on my template, but I haven't been able to find that information.

I've always generated my ribbon using "Office Custom UI Editor," which is not available for Word 2013; that tool "inserts" the xml into the template. My ribbon XML starts with this:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="SERibbon_Load">
    <ribbon startFromScratch="false">
        <tabs>

Anybody know how to make my ribbon tab work with Word 2013?

2

2 Answers

3
votes

Well, it turns out that there really isn't a problem with my ribbon or code. The installer code that installs the template installs both a ".dot" template (without a ribbon) for users with Word 2003 or earlier, and a ".dotm" template (with ribbon) for more recent versions of Word. It then sets up a shortcut to the template on the user's start menu.

The installer code isn't recognizing that Word 2013 was installed, and is concluding that the user is using Word 2003, and thus creating a shortcut to the ribbon-free version of the template. I changed the shortcut to point to the ".dotm" version, and all is well. So it turns out that my custom ribbon tab works fine in Word 2007/2010/2013. I just had to fix my installer to detect Word 2013 (version "15" in the registry) is installed.

The namespace apparently changed in 2010, but is backward compatible with 2007. 2010 added things to the namespace, 2013 added new things, but my understanding is that it's the same schema, and thus also backward compatible with Word 2007 ribbon definitions.

G

0
votes

I haven't done this yet, myself, but check out this thread from msdn: http://social.msdn.microsoft.com/Forums/en-US/officegeneral/thread/6575cee8-796a-40da-9520-24c5161f7600.

It looks like the namespace is the same, but some attribute values may have changed. You may have want to check against the documentation to see if your ribbonXML is in compliance: http://www.microsoft.com/en-us/download/details.aspx?id=727.