Outlook: Event handling regarding simplified ribbon

Add-in Express™ Support Service
That's what is more important than anything else

Outlook: Event handling regarding simplified ribbon
Does ADX offer any options to work with the simplified ribbon in Outlook? 
jkirstaetter




Posts: 1
Joined: 2023-03-16
Hi,

I'm trying to get a better grip on the button handling using the simplified ribbon in Outlook.

Requirement: I would like to show our add-in group/button at a different location in the simplified ribbon compared to the regular one.

I'm already working with two buttons with different properties given the image size and so forth depending whether Outlook is used with the regular or with the simplified ribbon. This is mainly used to switch visibility and it currently comes down to checking the key "EnableSingleLineRibbon" in the the Windows Registry like below.
However I cannot handle displaying the button.Text property or not depending on the window width of Outlook.


        /// <summary>
        /// Checks whether the targetted Office application uses the simplified ribbon or not.
        /// </summary>
        /// <returns>State whether the targetted Office application uses the simplified ribbon or not (default=false).</returns>
        internal static bool UsesSingleLineRibbon()
        {
            DebugOut("Start");
            bool result = false;

            try
            {
                AddinModule module = ADXAddinModule.CurrentInstance as AddinModule;
                var keyName = $"HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\{module.HostName}\Preferences";
                result = (int)(Registry.GetValue(keyName, "EnableSingleLineRibbon", 0) ?? 0) == 1;
            }
            catch (Exception ex)
            {
                DebugOut(ex.Message);
            }
            DebugOut(result.ToString());

            return result;
        }


However, I'm wondering whether the current Release 10.1.4703 of ADX provides more to work with the simplified ribbon, ie. event handling for pinning/unpinning, detection of resize as the built-in ribbon groups and ribbon button dynamically adjust to the width of the Outlook window.

If not, what are the suggestions to resolve this?

Also, something of concern. It's been over a year since the last release. Would you mind to give an update regarding this? Thanks, much appreciated.
Best regards, Jochen

"The only frontiers are in your mind."

Microsoft MVP - Developer Technologies
Google Developer Expert - Google Cloud
Posted 07 Jun, 2023 09:14:42 Top
Andrei Smolin


Add-in Express team


Posts: 19122
Joined: 2006-05-11
Hello Jochen,

Add-in Express can't change the Ribbon rules that Microsoft implies.

There's a command named Switch Ribbon (IdMso="SingleLineRibbonToggle", type=toggleButton); find it in the Customize the Ribbon dialog, 'Choose command from' should be set to 'Commands Not in the Ribbon' or to 'All Commands'. It switches the Ribbon to the Simplified Ribbon and back.

I assume you'll need to put an ADXRibbonCommand component onto the add-in module, set its IdMso to "SingleLineRibbonToggle" and ActionTarget to ToggleButton. When the component fires the OnAction event, you call CommandBars.GetPressedMso(theIdMso) to get the pressed state of that control. This allows you to have two Ribbon controls in different parts of the Ribbon so that only one of them is visible.

jkirstaetter writes:
ie. event handling for pinning/unpinning.


I suppose you should use other IdMso's for this. Check "MinimizeRibbon" and "HideRibbon"; these are togglebuttons, too.

jkirstaetter writes:
detection of resize as the built-in ribbon groups and ribbon button dynamically adjust to the width of the Outlook window.


As far as I know this isn't interceptable as per the Office Ribbon API. The only way to deal with this is to pre-set ADXRibbonGroup.AutoScale before the Ribbon components on your add-in module are parsed.

Regards from Poland (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 08 Jun, 2023 10:03:15 Top
Andrei Smolin


Add-in Express team


Posts: 19122
Joined: 2006-05-11
I'm sorry, I've missed you last question.

We are close to releasing a new build. But this formula doesn't let me tell you when this occurs. Alas. Once I know this, I'll post it here.

Regards from Poland (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 08 Jun, 2023 11:03:23 Top
Andrei Smolin


Add-in Express team


Posts: 19122
Joined: 2006-05-11
Hello Jochen,

An update on the new build. We've started the process of buying a new Extended Validation Code Signing certificate. We need it to fix Add-in Express issues in ClickTwice.

Regards from Poland (GMT+1),

Andrei Smolin
Add-in Express Team Leader
Posted 22 Jun, 2023 06:19:34 Top
Andrei Smolin


Add-in Express team


Posts: 19122
Joined: 2006-05-11
Hello Jochen,

We are going to publish the new Add-in Express build this week.

Regards from Poland (GMT+1),

Andrei Smolin
Add-in Express Team Leader
Posted 07 Aug, 2023 11:50:24 Top
Andrei Smolin


Add-in Express team


Posts: 19122
Joined: 2006-05-11
Hello Jochen,

The new Add-in Express build is published at https://www.add-in-express.com/downloads/adxnet.php.

Regards from Poland (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 09 Aug, 2023 13:21:06 Top