Answered Customization of Office Ribbon Items

  • Wednesday, May 16, 2012 6:52 AM
     
     

    In excel i am able to manage the visibility of a Command Bar button say Sort and Filter, it works properly first time when the ribbon is loaded.

    But what i want is let say in my excel sheet i have a list object and my cursor is inside list object, i want to disable the command bar button, but when it is out side i want to enable it.

    How do i achieve this.


    K K Sanghi

All Replies

  • Wednesday, May 16, 2012 8:31 AM
     
     Answered
    you have to call ribbon.InvalidateControl to ask runtime to re-evaluate your callbacks for that button.
    • Marked As Answer by Krishna Sanghi Wednesday, May 16, 2012 10:33 AM
    •  
  • Wednesday, May 16, 2012 8:42 AM
     
     
    ribbon.InvalidateControl  works when we have Custom Ribbon Button not for in built buttons.

    K K Sanghi

  • Wednesday, May 16, 2012 9:00 AM
     
     
    i think it will also work if you repurpose built in buttons and provide callbacks. How do you manage it for first time when ribbon is loaded?
  • Wednesday, May 16, 2012 10:33 AM
     
     

    Thanks Damian,

    Call back worked by using ribbon.InvalidateControl 


    K K Sanghi