none
Modify Quick Access Toolbar at run time RRS feed

  • Question

  • Hello,

    I'm working with Office 2010 and Vistual Studio 2010.

    is possible add buttons to QAT in run time (programmatically)? (I want add buttons which call macros)

    thanks!


    Mauricio

    Thursday, August 23, 2012 3:01 PM

Answers

  • Hi Mauricio

    The real problem is your wanting to do this with the QAT. It wasn't designed for this kind of access.

    If you'd have these commands somewhere in the Ribbon, perhaps on a Tab and disabled, the user could right-click any command he wants and add it to the QAT. So you could provide the commands in a single place in the Ribbon and, if the user would like it to be more "accessible" he can add it to the QAT.

    The other possibilities would be to put the commands on the context (right-click) menu or in a Custom Task Pane (that can float like the old toolbars used to, or be docked right/left).


    Cindy Meister, VSTO/Word MVP

    • Marked as answer by MauricioUY Thursday, August 23, 2012 5:08 PM
    Thursday, August 23, 2012 5:00 PM
    Moderator

All replies

  • Hi Mauricio

    Yes-and-no. Could you please be more specific about what kind of application this is? Is it an Add-in, for example? Or are you putting VBA code in Office documents? Something else?

    Is this for your private use? Something for your business? Something you want to share/sell to others?

    What you ask cannot be done simply, nor can it be done "any old time while Word is running". In other words, there's no way to mimic how a user creates buttons.

    It requires either completely defining the Ribbon XML UI when Word at the time Word loads (can be done as part of an Add-in) or modifying the user's private QAT file while Word is not running.


    Cindy Meister, VSTO/Word MVP

    Thursday, August 23, 2012 4:17 PM
    Moderator
  • Hi Cindy,

    I'm working with an Add-in, and actually I'm allready customizing ribbon when my Add-in loads into Office (wrod, excel and powerpoint) using XML and templates files *.OfficeUI.

    This add-in is for use in our business.

    With Office 2003 we can add/remove buttons from the toolbar programmatically in run time, for example one of our custom buttons in 2003 lets the user selects some Area into our studio, when he/she selects this Area we programmatically add/remove some buttons on the toolbar.

    Now I want to do this with Office 2010....

    thanks.


    Mauricio

    Thursday, August 23, 2012 4:37 PM
  • Hi Mauricio

    The real problem is your wanting to do this with the QAT. It wasn't designed for this kind of access.

    If you'd have these commands somewhere in the Ribbon, perhaps on a Tab and disabled, the user could right-click any command he wants and add it to the QAT. So you could provide the commands in a single place in the Ribbon and, if the user would like it to be more "accessible" he can add it to the QAT.

    The other possibilities would be to put the commands on the context (right-click) menu or in a Custom Task Pane (that can float like the old toolbars used to, or be docked right/left).


    Cindy Meister, VSTO/Word MVP

    • Marked as answer by MauricioUY Thursday, August 23, 2012 5:08 PM
    Thursday, August 23, 2012 5:00 PM
    Moderator
  • yes, I already have this buttons in a custom tab, thouse buttons are macros. So maybe I will try with "Custom task pane", I going to looking for some examples about this.

    thanks Cindy!


    Mauricio

    Thursday, August 23, 2012 5:08 PM