Ribbon getImage Callback

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

Ribbon getImage Callback
Change ImageMSO Dynamically  
Mark Proctor




Posts: 6
Joined: 2019-07-20
Any chance of a VB example?
Posted 28 Jul, 2021 23:00:58 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Mark,

What do you need to achieve?


Andrei Smolin
Add-in Express Team Leader
Posted 29 Jul, 2021 06:37:57 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
For example, you can set {ribbon control e.g. ADXRibbonButton}.ImageMso="{new value here}". Is this what you need to do?


Andrei Smolin
Add-in Express Team Leader
Posted 29 Jul, 2021 06:46:32 Top
Mark Proctor




Posts: 6
Joined: 2019-07-20
Andrei,

Correct, to change image on a pressed toggle button.
Posted 29 Jul, 2021 09:10:40 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Mark,

Would you need this action to be reflected in Ribbon across all windows of the host application? Or only in the current window/document? What Office application are you using?


Andrei Smolin
Add-in Express Team Leader
Posted 30 Jul, 2021 09:32:33 Top
Mark Proctor




Posts: 6
Joined: 2019-07-20
Hi Andrei,

I?Â?Ð?ém using excel but it would be ideal to be able to have the same functionality as can be achieved in vba with the getimage callback no matter which office program is being manipulated.

Is not possible to add this functionality directly?

Of course both cases, all windows or active document would be welcomed.

Many thanks.
Posted 30 Jul, 2021 09:43:44 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
VBA? Mark, this callback is invoked in the add-in only. How do you expect VBA should participate in this?

Mark Proctor writes:
Of course both cases, all windows or active document would be welcomed.


Imagine a Ribbon button shown in N windows of the host application. If you simply set {ribbon control e.g. ADXRibbonButton}.ImageMso="{new value here}", the new image will be shown in all Windows. If this is what you need, you do not need to handle the getImage callback.


Andrei Smolin
Add-in Express Team Leader
Posted 30 Jul, 2021 09:48:38 Top
Mark Proctor




Posts: 6
Joined: 2019-07-20
Andrei,

I referred to vba only for the simplicity of changing an image on a button I.e. when the user depresses a button change the image via the getimage callback.

What I am trying to achieve is to be able to change an image on the fly, but with the method you mention of just setting the image and invalidating the ribbon this is not achieved.

I have searched the forum and come across quite some users quoting the same limitation. If it is possible with a simple assignment at runtime could kindly provide an example.
Posted 30 Jul, 2021 09:59:22 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Mark,

At the moment it looks like this is a bug in the code of Add-in Express. I cannot change the ImageMso property on the fly. I'll talk to our guys next Monday.


Andrei Smolin
Add-in Express Team Leader
Posted 30 Jul, 2021 10:51:24 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Mark,

I've found a workaround. Will post it here later today.


Andrei Smolin
Add-in Express Team Leader
Posted 02 Aug, 2021 03:18:48 Top