Word Ribbon UI Help

User avatar
Sam1085
3StarLounger
Posts: 318
Joined: 23 Aug 2016, 07:43
Location: Sri Lanka

Word Ribbon UI Help

Post by Sam1085 »

Hi,

I've a Word ribbon toolbar with few callback buttons. Is it possible to highlight the ribbon callback button when running a macro?

Thank you!
-Sampath-

User avatar
HansV
Administrator
Posts: 78883
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Word Ribbon UI Help

Post by HansV »

See if this reply helps.
Best wishes,
Hans

User avatar
Sam1085
3StarLounger
Posts: 318
Joined: 23 Aug 2016, 07:43
Location: Sri Lanka

Re: Word Ribbon UI Help

Post by Sam1085 »

Hi Hans,

Thank you for the resource. I refer that.. But I didn't understand properly.

Simply I have to view button highlight while running the respective macro. (See below snap shot for more...)
img.png
Thanks!
You do not have the required permissions to view the files attached to this post.
-Sampath-

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Word Ribbon UI Help

Post by Rudi »

All ribbon versions of Office requires the use of XML to create, modify and delete ribbon buttons. Modifying the ribbon can not be done using VBA.

You will need to use either the add-in that is mentioned in the post that Hans linked to (Ribbon Editor) or you can use Custom UI Editor for Microsoft Office.

These tools expose the XML that controls the ribbons and you will need to find the necessary coding to change the colour of the button in XML and edit it into the code using the above tools. (Sorry...this is outside my knowledge).
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
Sam1085
3StarLounger
Posts: 318
Joined: 23 Aug 2016, 07:43
Location: Sri Lanka

Re: Word Ribbon UI Help

Post by Sam1085 »

Thank you Rudi for your response.

Yes, I've create my ribbon toolbar by using Andypope ribbon editor in past. And now I'm using custom UI editor for that.

My ribbon, callback buttons are works fine. Only I need to know how to highlight the respective button while running the vba macro code. (If it's possible)

Thanks!
-Sampath-

User avatar
stuck
Panoramic Lounger
Posts: 8254
Joined: 25 Jan 2010, 09:09
Location: retirement

Re: Word Ribbon UI Help

Post by stuck »

As Rudi said, you can't tweak the Ribbon using VBA thus I doubt you can make the button on the ribbon change while code is running.

Instead, why not display messages in the Status Bar while the code runs? Something like this should work:

Code: Select all

    'inform user of progress
    With Application
        .Wait Now + TimeValue("00:00:01")
        .StatusBar = "hello world"
    End With
Ken

User avatar
Jay Freedman
Microsoft MVP
Posts: 1320
Joined: 24 May 2013, 15:33
Location: Warminster, PA

Re: Word Ribbon UI Help

Post by Jay Freedman »

Sam, take a look at the pages http://gregmaxey.com/word_tip_pages/rib ... rt_IV.html and http://gregmaxey.com/word_tip_pages/rib ... art_V.html, and download the demonstration files there. I haven't done this myself, but it should work to let you display one image when the button has not been pressed and a different image when it has been clicked. I'm not sure how you would return to the first image when the macro ends.