How to migrate Word ribbon tab from 2007/2010 to 2013 - vba

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?

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

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.

Related

Permanently append Customized Ribbons to PowerPoint file

I have written 2 Macros in PowerPoint and added the Macros to a customized ribbon named 'My Ribbon' to make those macros available at a click of a button. The only problem is the Ribbon disappears when someone else opens the PowerPoint on a different computer. The macros stay with the file but the customized ribbons do not and we have to create another customized ribbon, and place both macros to the ribbon every time we share the file across our drive.(Which is quite annoying)
I want to permanently append the customized ribbon to the PowerPoint so that anyone who opens the PowerPoint will be able to see the personalized ribbon with both Macros already on their version of PowerPoint.
VBA macros are not designed for distributing the code on multiple PCs. If you need to get a solution which can be installed on other PCs you need to develop an add-in. That's exactly they were invented for. Moreover, you can create an installer for the add-in. It will be installed as other applications on your PC. See Walkthrough: Creating Your First Application-Level Add-in for PowerPoint to get started.
If you choose to stay with VBA macros, you will have to edit the open xml document. See Customize the Word Ribbon User Interface for more information. The process is common for almost all Office applications (Outlook does't support that).
You could use such a program like Ribbon Editor to customize the Ribbon for your pptm file only. (No need for an AddIn it you want it deployed only with the file)

Template Ribbon Bar in Word 2010 and 2013

Two years ago, a client, using Word 2010, asked me to create a template with an extra tab for the Ribbon Bar containing some special buttons linked to the template's VBA.
They are now moving over to Word 2013 and want me to update their template to 2013 (i.e. removing the Compatibility Mode as well as adding a couple of extra buttons to their specialized tab. At this stage I have only updated their template to 2013 and not added any more buttons to their Ribbon tab. I have also put their updated template in the correct folder where all the templates are kept in my system.
I asked them to send me a document created in their 2010 version of the template, opened it in my 2013 version and found that TWO specialized tabs are added to the Ribbon Bar: one from their 2010 version and the other one from the 2013 version.
Can anyone advise me, please, whether they are stuck with two specialized tabs whenever they open documents created earlier in Word 2010 or is there something I can do in the 2013 version to prevent this?
By the way, I use the Office Custom UI Editor for the XML work.
It is not clear what XML markup you use for Word 2010 and 2013 templates. Are they different? Why do you need to have different custom UI?
You can read about the Fluent UI (aka Ribbon UI) in the following series of articles in MSDN:
Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

Word 2007 add-in for a custom ribbon - ribbon not visible in the saved document

I have a requirement where I need to have a custom ribbon added to the Word 2007 file which will be populated from some items. I created a add-in using this and pressing F5 opens Word file contains the newly added custom ribbon. But I save that word file and open that again and It does not have that newly added custom ribbon. I am sure I am missing something here.Could anybody throw some light?
I save that word file and open that again
Are you opening it again outside of the Word instance running from Visual Studio? Your add-in might only be available when you're debugging the project.
Check if an entry for your add-in exists in the registry, under:
HKLM\Software\Microsoft\Office\Word\Addins\.
If no entry exists, I've found that the easiest way to deploy a VSTO add-in to your machine is to create a setup project for it in Visual Studio.

VBA Application Migration from Office 2002 to Office 2007

Looking for Migration from Office 2002 - VBA Word Doc Application to Office 2007.
Issues: Though Office 2007 Supports VBA Application - VB Macro Code, Menu Bars are not appearing. Indeed, VBA Macro Menus display under "Add-ins".
On a study, I realized Office 2007 Supports XML - Ribbon. Is there any ideal approach to migrate VBA Macro Application to Office 2007?
Your best bet would be these two MSDN articles: Customizing the 2007 Office Fluent Ribbon and Creating a Custom Tab by Using Ribbon XML, although they look like they focus on doing it across all applications, rather than just one. There help docs for each Office app, to get them all try this Google query: site:msdn.microsoft.com office 2007 add button to ribbon.
This snippet, from the first link, should be what you're looking for:
What About Existing Solutions?
In previous versions of Office, developers used the command bars object model to build the Visual Basic code that modified the Fluent UI. In the 2007 release of Office, this legacy code continues to work in most cases without modification. However, changes made to toolbars in Microsoft Office 2003 now appear on an Add-Ins tab. The type of customization that appears depends on the original design of the add-in. For example, Office creates a Menu Commands group that contains items added to the previous menu structure (such as the File menu, the Insert menu, and the Tools menu). Office also creates a Toolbar Commands group that contains items added to the previous built-in toolbars (such as the Standard toolbar, the Formatting toolbar, and the Picture toolbar). In addition, custom toolbars that are added by an add-in or document appear in the Custom Toolbars group on the Add-Ins tab.

Easiest way to migrate Word 2003 custom macro toolbars into Word 2007?

I have a series of macros and toolbars that I developed for Word 2003. Now that my office is upgrading to Word 2007, I need to migrate them. The macros themselves migrate with zero effort, but the toolbars are a different issue. A random subset of the toolbars show up in the "Add-Ins" ribbon tab, but I haven't found a way to control which ones.
Something that may be a complication is that I deploy the macros by placing a template into a user's Word STARTUP folder (C:\Documents and Settings\username\Application Data\Microsoft\Word\STARTUP). While I can add macros from normal.dot into the Quick Access Toolbar, I cannot add macros from this startup template. I'd like a better, more structured layout anyway.
So, what's the easiest way to replicate my custom macro toolbars in Word 2007?
The macros and toolbars that I developed for Word 2003 are in a number of .dot files. I simply put these .dot files into my Startup folder. I restarted Word'07 an wallah, these Macro toolbars appeared in the Add-Ins ribbon.
Good Luck