Discussion:
CommandBarButton Click event doesnt be fired?
(too old to reply)
Hurry Wood
2005-04-15 08:49:05 UTC
Permalink
Recently, I make some code for adding a menu entry into menu command bar of
MS WORD9 with VC++6, then the problem was out, no Click event fired from
WORD application! But the same method that I used to add a command bar
button to my custom command bar before is ok. Does custom menu entry added
of MS WORD9 never fire click event?
Jean-Guy Marcil
2005-04-15 13:09:08 UTC
Permalink
Post by Hurry Wood
Recently, I make some code for adding a menu entry into menu command
bar of MS WORD9 with VC++6, then the problem was out, no Click event
fired from WORD application! But the same method that I used to add a
command bar button to my custom command bar before is ok. Does custom
menu entry added of MS WORD9 never fire click event?
No, you can add your own menus/buttons where ever you want and the events
behind them should fire.

There is something going on in your code... But this group is dedicated to
VBA, not C++...
Maybe someone that experienced with C++ will be along, but I would not hold
my breath!
You could try in one of the C++ groups.
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
***@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Alex
2005-04-15 22:45:09 UTC
Permalink
Post by Jean-Guy Marcil
There is something going on in your code... But this group is dedicated to
VBA, not C++...
Maybe someone that experienced with C++ will be along, but I would not hold
my breath!
You could try in one of the C++ groups.
Which "this" group?

Hurry Wood crossposted (and you replied) to:
microsoft.public.office.developer.com.add_ins
microsoft.public.office.developer.office.sdks
microsoft.public.officedev
microsoft.public.vc.atl
microsoft.public.word.vba.addins

4 of these groups are not dedicated to VBA and, in fact, one of them is dedicated to C++...

Best wishes,
Alex.
--
Address email to user "response" at domain "alexoren" with suffix "com"
Jean-Guy Marcil
2005-04-18 03:26:21 UTC
Permalink
Post by Alex
Post by Jean-Guy Marcil
There is something going on in your code... But this group is
dedicated to VBA, not C++...
Maybe someone that experienced with C++ will be along, but I would
not hold my breath!
You could try in one of the C++ groups.
Which "this" group?
I'll let you guess! ;-)
Post by Alex
microsoft.public.office.developer.com.add_ins
microsoft.public.office.developer.office.sdks
microsoft.public.officedev
microsoft.public.vc.atl
microsoft.public.word.vba.addins
4 of these groups are not dedicated to VBA and, in fact, one of them is dedicated to C++...
In fact (as you had correctly surmised), I had not noticed the
cross-posting... but my comments are still valid. Was it necessary to
crosspost to a vba group since there is a very slim chance that someone in
the VBA group will be able to help him? But hey, you never know!
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
***@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Cindy M -WordMVP-
2005-04-19 15:42:16 UTC
Permalink
Hi Hurry,
Post by Hurry Wood
Recently, I make some code for adding a menu entry into menu command bar of
MS WORD9 with VC++6, then the problem was out, no Click event fired from
WORD application! But the same method that I used to add a command bar
button to my custom command bar before is ok. Does custom menu entry added
of MS WORD9 never fire click event?
Without knowing more about how you designed your tool, it's difficult to say.
But the most common reason for the problem you describe happens if you do not
assign a unique string to each command bar control's TAG property.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
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 :-)
Alex
2005-04-20 14:56:40 UTC
Permalink
Hello Cindy,
Post by Cindy M -WordMVP-
Post by Hurry Wood
Recently, I make some code for adding a menu entry into menu command bar of
MS WORD9 with VC++6, then the problem was out, no Click event fired from
WORD application! But the same method that I used to add a command bar
button to my custom command bar before is ok. Does custom menu entry added
of MS WORD9 never fire click event?
Without knowing more about how you designed your tool, it's difficult to say.
But the most common reason for the problem you describe happens if you do not
assign a unique string to each command bar control's TAG property.
Are there other uses for the Tag property?
If not, it seems to me that assigning a UUID to it would be safest.
--
Address email to user "response" at domain "alexoren" with suffix "com"
Jean-Guy Marcil
2005-04-20 18:12:31 UTC
Permalink
Post by Alex
Hello Cindy,
Post by Cindy M -WordMVP-
Post by Hurry Wood
Recently, I make some code for adding a menu entry into menu
command bar of MS WORD9 with VC++6, then the problem was out, no
Click event fired from WORD application! But the same method that I
used to add a command bar button to my custom command bar before is
ok. Does custom menu entry added of MS WORD9 never fire click event?
Without knowing more about how you designed your tool, it's
difficult to say. But the most common reason for the problem you
describe happens if you do not assign a unique string to each
command bar control's TAG property.
Are there other uses for the Tag property?
If not, it seems to me that assigning a UUID to it would be safest.
It depends what you want to do.

In some cases, I need to display a toolbar based on some conditions stored
in document variables. Because many documents from the same template can
have different conditions, I use a Document_Change event to detect the
change, read the variable, and show/hide certain menus based on their tag
value. In such a case, to make my life easier, all menu related to the same
condition have the same tag. I guess you could add a unique identifier, and
use InStr to get the common string in the tag string value...
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
***@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Loading...