Get a specifc button Handle inside ribbon

  • Thread starter Thread starter Sink0
  • Start date Start date
S

Sink0

Hi,

Im trying to make a program that clicks on a specific button inside a specif
ribbon. I think i got use sendMessage to complete this task but first i need
to find the handle of the button. So far i can get the handle oh the excel
and then i used EnumChild Windows to find childs handles. But looking at the
child texts i cant get anything thats looks with a the ribbon or the button.
Can some one helpme? Should i look inside an specif child to find the ribbon
and then inside the ribbon to find the button? if yes which one? Thnaks

Sink
 
I don't think the ribbon exposes handles to the world, so I think you are
going to fail in this approach.

Why not just change the code inside the callback event to a separate macro,
call the macro from within the callback, and also where you need it.

HTH

Bob
 
only thing that have a handle is a 'window'. i don't think a ribbon button
is a window. anyway if you want to run a built in ribbon control you can
try commandbars.executemso i think. i don't think you can do same with a
custom control but then you can call the code yourself, not have to go
throuh the control

| Hi,
|
| Im trying to make a program that clicks on a specific button inside a
specif
| ribbon. I think i got use sendMessage to complete this task but first i
need
| to find the handle of the button. So far i can get the handle oh the excel
| and then i used EnumChild Windows to find childs handles. But looking at
the
| child texts i cant get anything thats looks with a the ribbon or the
button.
| Can some one helpme? Should i look inside an specif child to find the
ribbon
| and then inside the ribbon to find the button? if yes which one? Thnaks
|
| Sink
 
Hey thanks for the reply

How exatly i call the code myself. The button is inside a ribbon created by
an third part COM add-in.

Thanks
 
Wht you mean saying to change the code inside callback. Which callback? The
button is inside a ribbon that was createad by a third part add-in. Then it
open a new CommandBar so i have to fill some textboxes and finally press
another button.

Any idea?

Thanks
 
sorry, you are right if not your code you cannot call it. to bad they not
give us a way to execute custom controls.


| Hey thanks for the reply
|
| How exatly i call the code myself. The button is inside a ribbon created
by
| an third part COM add-in.
|
| Thanks
|
| "Homey" wrote:
|
| > only thing that have a handle is a 'window'. i don't think a ribbon
button
| > is a window. anyway if you want to run a built in ribbon control you
can
| > try commandbars.executemso i think. i don't think you can do same with
a
| > custom control but then you can call the code yourself, not have to go
| > throuh the control
| >
| > | > | Hi,
| > |
| > | Im trying to make a program that clicks on a specific button inside a
| > specif
| > | ribbon. I think i got use sendMessage to complete this task but first
i
| > need
| > | to find the handle of the button. So far i can get the handle oh the
excel
| > | and then i used EnumChild Windows to find childs handles. But looking
at
| > the
| > | child texts i cant get anything thats looks with a the ribbon or the
| > button.
| > | Can some one helpme? Should i look inside an specif child to find the
| > ribbon
| > | and then inside the ribbon to find the button? if yes which one?
Thnaks
| > |
| > | Sink
| >
| > .
| >
 
Then I think you are totally stymied.

HTH

Bob

Sink0 said:
Wht you mean saying to change the code inside callback. Which callback?
The
button is inside a ribbon that was createad by a third part add-in. Then
it
open a new CommandBar so i have to fill some textboxes and finally press
another button.

Any idea?

Thanks
 
Back
Top