How to disable/enable the button on CommandBar in add-in application?
-
Hi all! Now I am developing an add-in application. I had instantiated a sub-class of COM to expose the interface to Word. Then I add some commandbar buttons on the command bar. When user click a specified button, a data will be inserted into word document. The data inserted is created by an object of another class of mine, which is derived some interfaces of Word. This class can handle the event come from Word application. When the data was inserted, user can right-click on it. Then a pop-up menu will be displayed. When an item was chosen, I need to disable the button on command bar. Problem: I don't know how to control the button within data class. I had tried to transport the pointer of button into data class. But no appropriate way to implement it. I want to write a method and expose it as a member of interface. But I can't find a appropriate type to transport Office::CommandBarButton. I try to use IDispatch* to do it. But the code to convert and save the pointer can't through compilation. I don't know what I can do now. Is there some one can help me? Thank you! :) Sincerely.
There is some white cloud floating on the blue sky. That's the landscape I like.