Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.
Keeping track of a built in control? Or How to detect a saveable item in Outlook 2010

Answered Keeping track of a built in control? Or How to detect a saveable item in Outlook 2010

  • segunda-feira, 12 de março de 2012 22:30
     
     

    Hi!

    I want to build a custom button in the backstage view within Outlook 2010. This button is a custom save as button. Pressing the button should open the file dialog with a pre selected folder. This button should not be enabled all the time. It should behave like the built in save as button. It should be enabled when a saveable item is selcted. To figure out when and in which all the situations the save as button is saveable is to much work since their could be different situations.

    My idea was to track the built in save as button. When ever the backstage view is shown the custom save as button is going to be invalidated. That means the getEnabled callback for the custom save as button is executed. In that callback I wanted to read out the enabled state of the built in save as button and return that value. In this way the custom save as button is always enabled when the built in one is enabled. After research I have figured out that tracking the state of a (built in) control is impossible.

    Is there a different way to figure out when the custom save as button should be enabled or not? Or better than that, is there a way to keep track of a control's state?

    Yavuz

Todas as Respostas

  • terça-feira, 13 de março de 2012 09:06
     
     Respondido
    CommandBars.GetEnabledMso("FileSave") does not work?
    • Marcado como Resposta Yavuz T terça-feira, 13 de março de 2012 12:06
    •  
  • terça-feira, 13 de março de 2012 12:06
     
      Contém Código

    Hi DamianD!

    I am doing in my getenabled callback function this

    public bool FileSaveAsCustomGetEnabled(IRibbonControl control)
    {
      var cbs = Globals.ThisAddIn.Application.ActiveWindow().CommandBars as Office.CommandBars;
      var enabled = cbs.GetEnabledMso("FileSaveAs");
      return enabled;
    }

    and it seems to be working. Thank You!

    Yavuz