O'Reilly logo

RibbonX: Customizing the Office 2007 Ribbon by Teresa Hennig, Ken Puls, Robert Martin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Callbacks: The Key to Adding Functionality to Your Custom UI

If you've worked through the earlier chapters, you already know some of the basics relating to Ribbon customization, such as XML structure, and you've had an introduction to VBA. This chapter introduces you to callbacks — the code that makes your customization work.

Without callbacks, your UI may look beautiful, but that's all it will be: just a pretty Ribbon — that is, of course, unless you are drawing from built-in controls, as they don't require custom callbacks. However, for custom controls, looks just aren't enough. What really matters is that your UI adds value for the user. In this chapter you learn the basics about how callbacks provide the functionality required for custom controls to work.

In the following pages you learn a combination of XML and VBA, as you will need to specify a callback in your XML code and then write VBA code to match and handle that callback. As you are preparing to work through the examples, we encourage you to download the companion files. The source code and files for this chapter can be found on the book's web site at www.wiley.com/go/ribbonx.

Callbacks: What They Are and Why You Need Them

Callbacks are subprocedures and functions used by your custom UI to make your customization work. A callback simply represents the movement of the instruction given. For example, when you set the onAction attribute for a button and load the UI, once the button is clicked it generates a callback ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required