none
RibbonDropDownItems not visible after creating new mail RRS feed

  • Question

  • For every receiver the user types in the "To" field my add-in will create a corresponding `RibbonDropDown` item which I will add in a `RibbonGallery`. After the event is triggered the following code is executed:

        private void updateGallery(string name, string address, string gender, double probability)
        {
    Globals.Ribbons.Ribbon1.RibbonUI.Invalidate();

    Microsoft.Office.Tools.Ribbon.RibbonDropDownItem itemReceiver = Globals.Factory.GetRibbonFactory().CreateRibbonDropDownItem();
    itemReceiver.ScreenTip = address;
    itemReceiver.Tag = gender;
    itemReceiver.Label = name;
            itemReceiver.SuperTip = (probability * 100).ToString() + " % Probability";

    Globals.Ribbons.Ribbon1.gallery1.Items.Add(itemReceiver);
        }

    Note: *gallery1* is the `RibbonGallery`.

    In the first mail item the UI works as intended. When the user is creating a new mail the gallery doesn't update its items anymore. The code will still be executed, but the new items will not be shown in the UI.

    I tried using `Invalidate`, but either I'm doing it wrong or/and it doesn't seem to work. The add-in also generates a salutation based on the contents of *gallery1*. The add-in generates a salutation in the mail body, so the content of *gallery1* is legit but not shown at all. I would like to add some pictures to show you the UI, but I'm not allowed to add images or links to this thread since my account is still getting verified. 

    Tuesday, February 12, 2019 12:47 PM