views:

325

answers:

1

Using VBA, can I find out the value of a text (combobox) control on the Word 2007 ribbon?

Say I'd want to read the currently selected font name in the "Home" tab.

I've seen an example using the IAccessible interface to do some interaction with the Ribbon (namely enumerating it), but it seems reading a control value is not possible. Is there another way to do it, or is VBA locked out completely?

+1  A: 

Hi,

I don't think you can get at the ribbon to read the built in properties. For you specific example of Font name you can use the following.

msgbox application.commandbars.findcontrol(ID:=1728 ).text

You maybe able to adpat the approach for other information.

Andy Pope