Problems with event handling after using the new document button

N

neoret

Hello.

I've developed an addinn for word and excel in C#. This addin does the
following:
- Adds a button to the command bar
- Adds event handling on the save event.

Both of these functionalities are added in the connect class. They
work fine when being used on the first document that is shown in word/
excel.

My problem occurs when I open i.ex word and presses the "new document"
button. Then the event handling on the save event doesn't work any
more. The button added works fine.

Any suggestions?

neoret ;)
 
T

Tommie Johansson

Hi!
I have similar problems as neoret has.
I do declare the buttons on class level, but I still loose the events after
I click "New Document" button on the toolbar.
I have tried the code supplied by Wei Lu[MSFT] in the post "CommandBarButton
click event does not fire" on 1/17/2007.
Same result. The event won't fire in the new document, but does fire on the
original.

Regards

/Tommie
 
X

XL-Dennis

Thanks for the info Tommie.

---------------
With kind regards,
Dennis
Weekly Blog .NET & Excel: http://xldennis.wordpress.com/
My English site: http://www.excelkb.com/default.aspx
My Swedish site: http://www.xldennis.com/


Tommie Johansson said:
Hi!
I have similar problems as neoret has.
I do declare the buttons on class level, but I still loose the events after
I click "New Document" button on the toolbar.
I have tried the code supplied by Wei Lu[MSFT] in the post "CommandBarButton
click event does not fire" on 1/17/2007.
Same result. The event won't fire in the new document, but does fire on the
original.

Regards

/Tommie

XL-Dennis said:
Hi,

If you declare the buttons on class module level instead of procedure level
then they will not go out of scoop after the first time.

---------------
With kind regards,
Dennis
Weekly Blog .NET & Excel: http://xldennis.wordpress.com/
My English site: http://www.excelkb.com/default.aspx
My Swedish site: http://www.xldennis.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top