#1
|
|||
|
|||
how to activate a controlMso
Hello,
Can someone tell me how to activate a controlMso from VBA? Here is what I have in my ribbon : <control idMso="ReviewSendForReview" enabled="false" /> Thanks in advance ! Best regards, David |
#2
|
|||
|
|||
Try this:
Code:
Application.CommandBars.ExecuteMso ("ReviewSendForReview") |
#3
|
|||
|
|||
Thank you very much for your feedback!
Actually, it's not "execute" the Mso control that I need, it's put enabled="True" to the line of code in the xlm file of my ribbon <control idMso="ReviewSendForReview" enabled="false" /> It's a locked button in my personal bar, it is locked at le loading, and i want to unlock it after a certain user action. My tab bar is called "TC_Tab". Best Regards, David |
#4
|
|||
|
|||
Sorry, I don't know how to do that. I can see the XML file for custom ribbons in the UI file here:
C:\Users\<username>\AppData\Local\Microsoft\Office \Word.officeUI ...and I can manipulate the boolean value there, but I don't know how to do it with VBA except to open/modify the .officeUI file externally, but it's already loaded when Word is open, so changing it has no effect. My guess is, to change it while Word is open, you'd need to programmatically remove the button, not change its visibility attribute, then add it back when Word is closed. Someone on this board will know how to do that. |
#5
|
|||
|
|||
That's okay! Anyway, thanks for your time!
Best Regards, David |
#6
|
||||
|
||||
Rather than including in the ribbon code the Enabled=True, you need to use the attribute getEnabled and include a callback macro to work out whether the button is enabled or not
See Confused over getEnabled for Ribbon Note that when fiddling with code AFTER the ribbon has loaded, you may discover the updated code doesn't execute. Either reload the ribbon or close/reopen the document containing the ribbon to ensure the code is working.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#7
|
|||
|
|||
Hello Guessed and thank you for your answer.
Great, I will try the callback on getEnabled. I hadn't thought about it! Best REgards, David |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Activate Access | shconner | Office | 1 | 09-15-2016 10:18 PM |
How do I activate the status bar? | rbantjes | Word | 2 | 06-29-2016 04:04 PM |
Activate fields | Formd | Word VBA | 2 | 07-31-2015 11:19 AM |
Activate ms office again | helpp | Office | 1 | 07-21-2015 01:55 PM |
check box will not activate | survivo01 | Word | 1 | 10-04-2012 03:34 PM |