Modifying the Ribbon – Part 9

The history of posts on the Ribbon can be found at the Ribbon Example Table of Contents.

In this article I'm going to demonstrate using an "edit box" to change the description of a button on the Ribbon.

XML Markup

Unlike in prior examples, the XML Markup we'll use here uses a callback to assign the button name, which allows it to be dynamic:


6 thoughts on “Modifying the Ribbon – Part 9

  1. great article
    however, is it possible to get the editbox text without hitting enter?
    for example, i have an editbox that a user can type in search criteria. there is also a search button. once the user enters search text, he wants to be able to click the search btn.but this action doesn't fire a change event. any ideas?

  2. Hi Chris,

    Sorry, but I don't know what to tell you here. Using the example code in this post, I was able to type text in the edit box, not hit enter, and when I click the button it renames it. I can't see why it wouldn't work for your purpose.

  3. I have a question otherway round.
    Is it possible to track the keypress and act accordingly. I want the same functionality as Chris mentioned. But in my case I would like to give the functionality of type text and press 'enter' to search. Is that possible? Some pointers if it is.


  4. Hi Aditya,

    Unfortunately, it doesn't seem possible at this point. Where the VBA userform's onChange event fired each time you entered a new character, the editBox's callback is only fired when you the control loses focus (by clicking elsewhere or pressing Enter.)

    The only way I can think of integrating a full "hot" searchbox into the new UI is to create a custom Taskpane to do so. Unfortunately, since we can't create taskpanes within the Office apps themselves, this involves using Visual Stuio, and probably VSTO. I haven't tried it myself, though. so can't be 100% sure on this.

  5. Hi,

    How we can enter password characters in editbox or is there any other control which we can enter password character in control in ribbon


If you have a comment or question about the blog post content, please feel free to post it here. If you need help adapting this solution to your own needs, please post in our free help forum.

Your email address will not be published. Required fields are marked *