CommandBarButton Click event doesnt be fired?

H

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?
 
J

Jean-Guy Marcil

Hurry Wood was telling us:
Hurry Wood nous racontait que :
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
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
A

Alex

Jean-Guy Marcil said:
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.
 
J

Jean-Guy Marcil

Alex was telling us:
Alex nous racontait que :
Which "this" group?

I'll let you guess! ;-)
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++...

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
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
C

Cindy M -WordMVP-

Hi Hurry,
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 :)
 
A

Alex

Hello Cindy,

Cindy M -WordMVP- said:
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.
 
J

Jean-Guy Marcil

Alex was telling us:
Alex nous racontait que :
Hello Cindy,



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
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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