0
votes

When the width of an Outlook Explorer or Inspector window is reduced the ribbon changes. In my VSTO addin can I influence how the scaling happens with the Office Ribbon?

Further at a certain width the tab becomes a single icon with a small arrow which when clicked the buttons/elements of the tab appear in a pop-up. How can I set the icon that appears in this case?

Below is my current XML for the tab.

I have also added a picture of how my ribbon looks when the window is made narrow.

I am not able to find a new XML Markup from Microsoft is this really the latest version [MS-CUSTOMUI2]: Custom UI XML Markup Version 2 Specification

Image of narrow ribbon with single button and arrow

<tabs>
<!-- Creates a new App Tab on the inspector toolbar-->
<tab idMso="TabReadMessage">
  <group id="AppGroup" label="App">
    <!-- A toggle or ON/OFF button to Encrypt or Decrypt an email and show the current encryption -->
    <toggleButton id="insDecryptButton"
        getLabel="insDecryptButton_getLabel"
        size="large"
        onAction="insDecryptButton_ButtonClick"
        getImage="insDecryptButton_getImage"
        getSupertip="insDecryptButton_getSupertip"
        getScreentip="insDecryptButton_getScreentip"
        getPressed="insDecryptButton_getPressed"
                  getVisible="insDecryptButton_getVisible"/>

    <!-- A Button with drop down that shows all the File Numbers in the Email. If there are no file numbers this will not appear. -->
    <dynamicMenu id="insMenu"
               getLabel="insMenu_getLabel"
               size="large"
               getImage="insMenu_getImage"
                 getVisible="insMenu_getVisible"
                 getSupertip="insMenu_getSupertip"
                getScreentip="insMenu_getScreentip"
               getContent="insMenu_getContent"/>

    <!-- Button to upload the email or attachments to IPAS -->
    <dynamicMenu id="upMenu"
               getLabel="upMenu_getLabel"
               size="large"
               getImage="upMenu_getImage"
                 getVisible="upMenu_getVisible"
                 getSupertip="upMenu_getSupertip"
                getScreentip="upMenu_getScreentip"
               getContent="upMenu_getContent"/>
  </group>
</tab>

1
You can assign an image to the group using getImage as well.aduguid
thank you. I was searching for something in the tab and ignored the group element. Make your comment the answer if you want.darbid
No worries mate. Glad I could help. I have a bunch of examples of VSTO Addins in GitHub if it helps. github.com/aduguidaduguid

1 Answers

0
votes

Office applications perform the scaling optimization on its own. There is no new schema for that. Instead, as other poster noticed, you need to provide the getImage callback to all your group controls. It should look like this:

 C#: IPictureDisp GetImage(IRibbonControl control)
 VBA: Sub GetImage(control As IRibbonControl, ByRef image)
 C++: HRESULT GetImage([in] IRibbonControl *pControl, [out, retval] IPictureDisp ** ppdispImage)
 Visual Basic: Function GetImage(control as IRibbonControl) as IPictureDisp

Calling the Invadiate or InvalidateControl you may get a new image displayed (so, your callback will be invoked).

Read more about the Fluent UI (aka Ribbon UI) in the following articles:

If you want to know more about dynamic customizations you may take a look at: