Chapter 13. Overriding Built-in Controls in the Ribbon
In this chapter, we get into the issues and details associated with overriding built-in controls in the Ribbon. We'll also show you how easy it is to get rid of the built-in Ribbon, so if you truly want to remove all of the tabs and major controls in the Ribbon, you can do that with just one command. Thankfully, that will still leave you with some basic controls for handling the project.
Covered here are topics to help you plan and implement your customizations in the event that you deem such a drastic overhaul is the right approach for a project. We start by explaining how to build a UI from scratch.
Deciding to start a project from scratch is not an easy decision. In fact, it might seem counterintuitive, as we typically want to add new features, rather than remove existing tools. However, there may be times when this is necessary, such as when you build a front end in Excel, Access, or Word and only want selected commands to be available to the user. Whether they are custom commands, built-in commands, or a combination of the two, you need to start by removing the existing Ribbon. That means you need to use the startFromScratch
attribute to remove the Ribbon so that you can then add back only the commands that you want to make available to users.
If you have built custom menus and toolbars in previous versions of Office, you will remember how challenging it can be to completely remove the standard menu and toolbars. Even worse ...
Get RibbonX: Customizing the Office 2007 Ribbon now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.