Search code examples
c#.net-3.5office-2007office-interop

Hide/disable/remove/shootintheface office 2007 ribbon programmatically


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?


Solution

  • 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.