Need the location of the ribbon button pressed


D

David Thielen

If you look in Word at Insert, Table it clearly is placing a dialog
box right under the button when it is pressed. I need to do the same
thing.

How can I determine the lower left corner of a ribbon button whe it is
pressed? It passes in IRibbonControl.Context but that is the window
holding the entire ribbon.

thanks - dave

david@at-at-at@windward.dot.dot.net
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
Ad

Advertisements

C

Colbert Zhou [MSFT]

Hello Dave,

Unfortunately, we cannot get the exact location of ribbon button pressed.
Currently, no Office APIs exposed for a ribbon control's position. And the
ribbon controls are drawn directly by Office application, so they are not
tranditional native window. We cannot get their positions by calling
Windows API either.

See my same discussions recently in MSDN forum,
http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/2c309a7a-8e7b-4035
-814c-7b0d5d70fd96


Best regards,
Ji Zhou
Microsoft Online Community Support
 
D

David Thielen

Hello Dave,

Unfortunately, we cannot get the exact location of ribbon button pressed.
Currently, no Office APIs exposed for a ribbon control's position. And the
ribbon controls are drawn directly by Office application, so they are not
tranditional native window. We cannot get their positions by calling
Windows API either.

See my same discussions recently in MSDN forum,
http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/2c309a7a-8e7b-4035
-814c-7b0d5d70fd96
OW! Ok, we'll use the mouse position - but I'm not wild on that.

thanks - dave

david@at-at-at@windward.dot.dot.net
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
T

Tony Jollans

This can be done using the Accessibility Interface - see my website for a
basic example of using it in VBA. Once you get an IAccessible interface for
your control, you can use the accLocation method to get the location.
 
Ad

Advertisements


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