Word Menu Item Not Firing

M

mikebabb

I have an Office addin written in C#. When I run it in my development
environment, everything works fine. However, when a build of our
product is created and installed on another machine, one of the four
selections of a menu I've added doesn't fire an event when clicked.
I've done things suggested in other posts with similar problems such as
making sure that an Office object that fire events is kept around as a
class member as opposed to a local variable in order to avoid garbage
collection issues, but I'm still experiencing the problem. Also, this
problem seems to show up randomly. Apparently, this is used to work
and no code was changed, but it suddenly stopped working. Any
suggestions would be appreciated.
 
C

Cindy M -WordMVP-

I have an Office addin written in C#. When I run it in my development
environment, everything works fine. However, when a build of our
product is created and installed on another machine, one of the four
selections of a menu I've added doesn't fire an event when clicked.
I've done things suggested in other posts with similar problems such as
making sure that an Office object that fire events is kept around as a
class member as opposed to a local variable in order to avoid garbage
collection issues, but I'm still experiencing the problem. Also, this
problem seems to show up randomly. Apparently, this is used to work
and no code was changed, but it suddenly stopped working. Any
suggestions would be appreciated.
You're absolutely certain the event isn't firing? That it's not on the
Word side (something can't be executed, and a try block is hiding that)?
You've tried sticking a "HI" MessageBox in there?

Was a value assigned to the control's TAG property? Forgetting this can
cause "off-and-on" problems.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
M

mikebabb

I'm about 99% sure the event isn't firing, but you're right I should
put in a message box to confirm this. And, yes a value was assigned to
the TAG property. Thanks for your suggestions.

Mike
 
C

Cindy M -WordMVP-

I'm about 99% sure the event isn't firing, but you're right I should
put in a message box to confirm this. And, yes a value was assigned to
the TAG property. Thanks for your suggestions.
One other "known" thing that can cause what you're seeing:

The objects (buttons) you've linked to the event callbacks may be getting
garbage collected because they're going out of scope. Have you declared the
Button objects at the class level?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
M

mikebabb

Yes, that's something I've made sure of.
One other "known" thing that can cause what you're seeing:

The objects (buttons) you've linked to the event callbacks may be getting
garbage collected because they're going out of scope. Have you declared the
Button objects at the class level?


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)


This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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