Mark Sh

I have an IDTExtensibility and IRibbonExtensibility add-in to Word 2007. One method exposed on the ribbon allows the user to open a document from a database into Word. However, after doing so the menu selection is reset to "Home", instead of the ribbon the user was on prior. I am having difficulty finding the method to call to force Word to select my ribbon.

Any help would be greatly appreciated. Thanks.



Re: Visual Studio Tools for Office Select active menu/ribbon at runtime

Cindy Meister

Hi Mark

There is simply nothing the Ribbon exposes that will let you programmatically select which Tab is active in the Ribbon. Best you can do is a "SendKeys" command that presses Alt plus the control key assigned to a Ribbon tab. Unfortunately, though, this could conflict with Ribbon tab assignments from other add-ins.

A possible alternate approach would be to generate a custom task pane (CTP) that exposes the relevant commands available in your Ribbon tab for work with the new document.






Re: Visual Studio Tools for Office Select active menu/ribbon at runtime

Mark Sh

Just to clarify, as the nomenclature is fuzzy for me, I am referring to selecting the menu item at the top so that my whole ribbon displays. I am not concerned with focusing on a particular region within my ribbon. It sounds like that is what you are referring to Cindy, but I wanted to try to clarify in case I was not understanding correctly.

I would have thought that there would be a method off of the word application object to do this or even the document object, but I cannot find one.





Re: Visual Studio Tools for Office Select active menu/ribbon at runtime

Cindy Meister

Hi Mark

"Tabs" are the labels across the top of the Ribbon. Sections within a Ribbon are "Groups".

Indeed, what you're looking for hasn't been provided in the object model - by design. It's often requested by developers, and has been answered a number of times in this forum, as well as in other venues :-)

The philosophy behind the behavior is that the user should feel in control; the Ribbon interface should be as static and predictable as possible. So the user should always be starting in the "Home" tab.






Re: Visual Studio Tools for Office Select active menu/ribbon at runtime

Mark Sh

I cannot say that I agree with that philosophy, but not much I can do about it either. I apologize if this has been answered before, but my searches did not turn up anything. Thank you for clarifying.