Outlook single line ribbon (officeSL)

133 Views Asked by At

I am writing an Outlook add-in with its own button in the ribbon bar. I am using C# and for customizing the ribbon XML.

My goal is to always show the button in Outlook 2021 with single line ribbon layout, no matter how wide the window is.

As a test, I pinned a button directly in the Outlook User Interface so that it is always displayed.

The following XML code is created in the file "olkexplorer.officeSL":

<mso:customUI xmlns:mso="http://schemas.microsoft.com/office/2009/07/customui">
    <mso:ribbon>
        <mso:qat/>
        <mso:tabs>
            <mso:tab idQ="mso:TabMail">
                <mso:group idQ="mso:GroupSpeech" autoScale="true">
                    <mso:control idQ="mso:ReadAloud" isPinnedToRibbon="true" visible="true"/>
                </mso:group>
            </mso:tab>
        </mso:tabs>
    </mso:ribbon>
</mso:customUI>

The term isPinnedToRibbon is marked with a green wavy line. In Outlook the pinning works as desired.

However, when I want to use this in my code, I get an error when starting Outlook that isPinnedToRibbon is an unknown command.

How can I use this function? Would I need to use a newer scheme since the single line layout was added to Outlook later?

In this example i would like to pin the menu item "Team-E-Mail" in order to keep it while the window width is reduced. Right clicking in Outlook an pinning it does this successfully but the code produced in the background (see above) does not work.

Wide window little bit narrower window

1

There are 1 best solutions below

3
On

The Fluent UI XML doesn't provide the isPinnedToRibbon attribute for their controls. You can read about possible elements and their attributes in the following articles: