1

When you resize excel - ribbon would auto-scale to fit. And if needed groups are replaced with a single button. imgur.com/ahxyADt

But as you can see it uses a placeholder with custom groups.

According to learn.microsoft.com:

You can specify the icon that appears when the group is compressed to a single button by assigning an image to the group itself.

However I cannot assign imageMSO to the group even though it's listed in attributes.

I get an error The 'imageMSO' attribute is not declared. in Office RibbonX Editor. And if I apply XML anyways - nothing happens.

Is there a way to apply imageMSO?

PS: I tried 'image' attribute with embedded picture and that works. But not imageMSO.


Turned out that i had a typo in camelCase. Instead of imageMso i had imageMSO

Ali
  • 45
  • 6

1 Answers1

0

It is not clear what value is assigned to the imageMso attribute. The fact is that imageMso accepts only built-in controls IDs. You can find the list of controls IDs in the Office 2016 Help Files: Office Fluent User Interface Control Identifiers.

If you want to use a custom icon you need to specify the image attribute or implement the getImage callback. The callback has the following signature:

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
Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • I'm familiar with imageMSO as I use them for my buttons. However I'm having trouble with using it with groups. As I mentioned in my question, I managed to use *image* attribute. However I'd like to use Office Library instead of painting images in paint. – Ali Jul 18 '21 at 19:49
  • What value exactly did you try to specify for the `imageMso` attribute? – Eugene Astafiev Jul 18 '21 at 20:37
  • Thank you for your input. Turned out that i had a typo in camelCase. Instead of imageMso i had imageM**SO** – Ali Jul 19 '21 at 10:51
  • If the problem is solved I'd suggest marking the post as answer. – Eugene Astafiev Jul 19 '21 at 11:40