views:

59

answers:

3

We are embedding a word control inside of a winforms app, and need to hide and disable the ribbon on Office 2007 and 2010.

Is it possible to hide/disable the office 2007/2010 ribbon programmatically using the office interop dlls? Is there another method available to do this?

+1  A: 

In the user interface, Ctrl F1 will accomplish the hiding.

If you were able to send keys to the embedded app, that'd accomplish that.

System.Windows.Forms.SendKeys.Send("^{F1}");

More on SendKeys at MSDN.

p.campbell
Ctrl+F1 we tried, but we need the functionality disabled, because the user can press that again to toggle it.
Zachary Yates
+1  A: 

It is not possible to disable the Office 2007/2010 ribbon.

sixlettervariables
Not sure why the downvote, there is no way to "disable" the ribbon. You can hide tabs/etc, but the user can always put it back.
sixlettervariables
Yeah, it's annoying when people downvote without leaving a comment on the reason.
Tom Juergens
+2  A: 

I don't think you can disable the ribbon as such, but using a custom XML file you can hide the default tabs, groups and commands (or add your own). Setting the custom XML file can be done via interop (see IRibbonExtensibility and GetCustomUI). This may not be perfect, but perhaps better than nothing.

Tom Juergens
Oh, and one additional thought, you might want to consider not embedding Word at all, but using a stand-alone replacement without so many dependencies, instead - such as TxTextControl. This would be a major change and depends, obviously, on your intentions and requirements, so might not be a solution in your case.
Tom Juergens
We're trying to convince the customer of that today, actually.
Zachary Yates