I have problem with COM Add-in written in C++ (VS 2005).
My code is based on Microsoft Knowledge Base Article Q230689
On startup I create commandbar with few buttons. I subscribe to explorer events and on events FolderSwitch and SelectionChange I check current folder. If this is Contacts folder I check selected contact item fields and set or reset buttons Enabled property depending on field values.
I was expecting that Outlook redraws button immediately after changing his Enabled property. And this works as expected in Outlook 2003. But in Outlook 2007 button is redrawn only if I leave current selection either
- change selection or click the same item again (i.e if SelectionChange event fires again)
- deactivate explorer window,
- move cursor to any of outlook commad bars.
The only workaround I found is to cycle Enabled property for my command bar. This forces Outlook to redraw all buttons but this also causes annoying flickering.
May-be I do something wrong - this is my first MS Office Add-in.
My code was too big to post here, but I can do that if needed.
BR.
My code is based on Microsoft Knowledge Base Article Q230689
On startup I create commandbar with few buttons. I subscribe to explorer events and on events FolderSwitch and SelectionChange I check current folder. If this is Contacts folder I check selected contact item fields and set or reset buttons Enabled property depending on field values.
I was expecting that Outlook redraws button immediately after changing his Enabled property. And this works as expected in Outlook 2003. But in Outlook 2007 button is redrawn only if I leave current selection either
- change selection or click the same item again (i.e if SelectionChange event fires again)
- deactivate explorer window,
- move cursor to any of outlook commad bars.
The only workaround I found is to cycle Enabled property for my command bar. This forces Outlook to redraw all buttons but this also causes annoying flickering.
May-be I do something wrong - this is my first MS Office Add-in.
My code was too big to post here, but I can do that if needed.
BR.