Ali
Ali

Reputation: 45

Adding imageMSO to a custom ribbon group

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

Upvotes: 1

Views: 1402

Answers (1)

Eugene Astafiev
Eugene Astafiev

Reputation: 49395

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

Upvotes: 0

Related Questions