none
Ribbon not called on every NewInspector trigger RRS feed

  • Question

  • Hi 

    In our plugin we have used two custom ribbon1.xml   and ribbon2.xml  both are need to called based on condition of event triggered in NewInspector.  whatever ribbon loaded first keep its effect.

    Ribbon1.xml has

    <?xml version="1.0" encoding="UTF-8"?>
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
      <commands>
        <command idMso="Recurrence"  enabled="false"  />

    </commands>
    </customUI>

    Ribbon2.xml has

    <?xml version="1.0" encoding="UTF-8"?>
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
      <commands>
        <command idMso="Recurrence"  enabled="true"  />

    </commands>
    </customUI>

    initially if we load on first new inspector event ribbon1 then we can't able to load again ribbon2 on next  new inspector.

    inspector is related to outlook appointment

    this.Application..NewInspector += new InspectorsEvents_NewInspectorEventHandler(Inspectors_NewInspector);

    We want to achieve on each appointment opening check some code and load appropriate xml to make Recurrence button enable/disable.

    Kindly help asap.    


    Neeraj

    Monday, November 5, 2018 1:00 PM

All replies

  • That is not how i works - make sure you are using only one ribbon xml. If you want the button to be in different states, make sure you specify getEnabled callback in your XML and return the appropriate value.

    When NewInspector event fires, you can refresh the ribbon using IRibbonUI.InvalidateControl.

    IRibbonUI interface ca n be retrieved from the onLoad callback of the customUI element in you ribbon XML.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Monday, November 5, 2018 1:26 PM