Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

getEnabled Callback...

142 views
Skip to first unread message

rakishere

unread,
Mar 24, 2010, 12:27:00 AM3/24/10
to
Hi all,
 
 
I am developing a MS Outlook 2010 addin. Almost everything is working fine except the getEnabled callback.
I want to change the enable/disable status of a button based on user's folder selection change.
 
But it does not work properly. Cause getEnabled callback comes only when my add in loads first time.
Afterwards it does not. Although I call Invalidate of the add in's ribbon or InvalidateControl for that particular control.
 
getEnabled callback is working because it is called at onLoad for all buttons of ribbon.
 
Could any one help me?
 
 
_
Regards

Ken Slovak - [MVP - Outlook]

unread,
Mar 24, 2010, 8:46:37 AM3/24/10
to
Without seeing your ribbon XML no one can do anything but take wild guesses.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
 
 

rakishere

unread,
Mar 24, 2010, 8:55:06 AM3/24/10
to
<?xml version="1.0" encoding="utf-8"?>
 

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"
   onLoad="OnLoad">
 <ribbon>
  <tabs>
   <tab id="CustomTab" label="Custom Label">
    <group id="CustomGroup1" label="Actions">
     <button id="CustomButton1"
       size="normal"
       getVisible="GetVisible"
       getScreentip="GetScreenTip"
       getImage="GetImage"
       getLabel="GetButtonLabel"
       getEnabled="GetEnabled"
       onAction="OnButtonClick"/>
    </group>
   </tab>
  </tabs>
 </ribbon>
</customUI>
 
 
 
_
Regards
 
 

Ken Slovak - [MVP - Outlook]

unread,
Mar 24, 2010, 10:01:35 AM3/24/10
to
It looks OK to me. And you are calling Invalidate() or InvalidateControl("CustomButton1") and the callback doesn't fire?
 
Did you enable the error messages for any ribbon errors? It looks OK but one never knows...

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
 
 

rakishere

unread,
Mar 25, 2010, 1:11:51 AM3/25/10
to
"GetEnabled" callback functions called only once when Ribbon loads.
Afterwards, I invalidate any control or ribbon, it does not work.
 
>>> Did you enable the error messages for any ribbon errors? <<<
 
I have not done any error handling yet. I am wondering why callback is not coming to my function when I am calling invalidate ().
 
Could you please let me know what kind of error could come in such situation?
 
 
_
Regards

Ken Slovak - [MVP - Outlook]

unread,
Mar 25, 2010, 9:16:51 AM3/25/10
to
I'm not sure what kind of error could occur in that case, that's why error logging might help. I doubt it because the original callback is being made, but it doesn't hurt to try it.
 
I've never seen a case in either Outlook 2007 or 2010 where what you are describing happens. Usually if a callback works initially it will work when forced by either of the ribbon invalidation methods.
 
Are you sure you're actually hitting the code line or lines that are invalidating the controls?
 
Where are you calling to invalidate the controls? What event handler or other place in the code?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
 
 
Message has been deleted
Message has been deleted

anmi...@gmail.com

unread,
Jun 24, 2014, 6:55:16 PM6/24/14
to
Same situation here, altough I'm developing a Project 2010 Add-in

Developing environment: Win 8.1 x64, Office x64, Visual Studio 2013, VSTO up to date May 2014

I've added a new button to the Ribbon in the "Resources" tab and added a handler for "GetEnabled"

My callback function gets called only once, when I first click on the tab.
0 new messages