none
Disble buttons in QAT toolbar in Word 2010 RRS feed

  • Question

  • Hi,

    I have created a com add-in for word 2010 which will disable Print, Save and Save As button under file menu and now there is additional requirement that the Print, Save, Save as, Quick Print buttons in the QAT buttons also should be disabled.

    Is it possible to add the code in ribbon XML to disable these buttons also when the com add in loads and enable when the com-addin unloaded.

    Thanks,

    Krishna


    Krishna Prakash

    Tuesday, August 7, 2012 9:53 AM

Answers

  • I don't believe you can remove/disable items from the Quick Access Toolbar, based on the contents of this thread. Cindy Meister says:

    You can only affect the content of the QAT by using RibbonXML and setting startFromScratch="true", which means you'd need to effectively re-write the entire Ribbon.

    And Cindy is rarely wrong.

    You could handle the Application object's DocumentBeforeSave and DocumentBeforePrint events. By handling these, you could cancel saves/print commands, and instead display an error message to the user, and/or run other code.

    Tuesday, August 7, 2012 10:55 AM

All replies

  • I don't believe you can remove/disable items from the Quick Access Toolbar, based on the contents of this thread. Cindy Meister says:

    You can only affect the content of the QAT by using RibbonXML and setting startFromScratch="true", which means you'd need to effectively re-write the entire Ribbon.

    And Cindy is rarely wrong.

    You could handle the Application object's DocumentBeforeSave and DocumentBeforePrint events. By handling these, you could cancel saves/print commands, and instead display an error message to the user, and/or run other code.

    Tuesday, August 7, 2012 10:55 AM
  • Hi,

    If i use startFromScratch="true" in the XML, will all the Ribbon controls will be vanished. Also if i disable the com addin, will the word resume the existing ribbon controls?

    Thanks,

    Krishna.


    Krishna Prakash

    Tuesday, August 7, 2012 12:44 PM
  • Yes, all Ribbon controls will vanish. Also yes, they will re-appear when you disable the COM AddIn (I just tested it).
    Tuesday, August 7, 2012 1:31 PM