A
A Johnson
I'm developing several office addin applications with VS
2003 in C#, primarily for Word, and have run into the
issue outlined in the Knowledge Base article 230876.
I'm trying to Enable/Disabling several buttons in my
custom menu and toolbar during the application life cycle
but after several documents are opened and closed I
receive error when referencing the button object, Invalid
object.
I catch the error and use the suggested FindControl()
(tried using the CommandBar.Controls[] collection as well)
to get another reference to the object. This works but
then the event hander stops and the buttons no longer
respond to user interaction. If I re-register the Click
event (remove then add), the next time the user clicks I
get 2 events.
I'd appreciate any insight into a workaround to this known
issue in the office applications. I have sample code if
needed.
Thanks,
Al
2003 in C#, primarily for Word, and have run into the
issue outlined in the Knowledge Base article 230876.
I'm trying to Enable/Disabling several buttons in my
custom menu and toolbar during the application life cycle
but after several documents are opened and closed I
receive error when referencing the button object, Invalid
object.
I catch the error and use the suggested FindControl()
(tried using the CommandBar.Controls[] collection as well)
to get another reference to the object. This works but
then the event hander stops and the buttons no longer
respond to user interaction. If I re-register the Click
event (remove then add), the next time the user clicks I
get 2 events.
I'd appreciate any insight into a workaround to this known
issue in the office applications. I have sample code if
needed.
Thanks,
Al