guxiyou
asked on
How can I remove/disable the Office Button from MS Word 2007?
I am attempting to embed a MS Word 2007 instance inside a C# Application. I want to make the embedded instance of Word as simple as possible, and I don't want the end users to be able to do anything that will interfere with the intended use of the application. To accomplish this goal, I want to disable open/save/close file functionality. Using xml I am able to disable most of the problem functionality, but the Office Button is still causing me problems. I can remove most of the options, but I have been unable do hide/disable the Office Button, and I have been unable to remove the "Recent Documents" functionality from the menu itself.
I will give points for a solution for how to hide/disable the Office Button, or for how to remove the "Recent Documents" from the Office Button.
I will give points for a solution for how to hide/disable the Office Button, or for how to remove the "Recent Documents" from the Office Button.
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<commands>
<command idMso="FileNewDatabase" enabled="false"/>
<command idMso="FileCloseDatabase" enabled="false"/>
<command idMso="ApplicationOptionsDialog" enabled="false"/>
<command idMso="FileOpenDatabase" enabled="false"/>
<command idMso="FileExit" enabled="false"/>
</commands>
<ribbon startFromScratch="true">
<tabs>
<tab idMso="TabHome" visible="true" />
<tab idMso="TabInsert" visible="true" />
<tab idMso="TabPageLayoutWord" visible="true" />
<tab idMso="TabReferences" visible="true" />
<tab idMso="TabMailings" visible="true" />
<tab idMso="TabReviewWord" visible="true" />
<tab idMso="TabView" visible="true" />
</tabs>
<officeMenu>
<control idMso="FileOpen" visible="false" />
<control idMso="FileNew" visible="false" />
<control idMso="FileNewDatabase" visible="false"/>
<control idMso="SourceControlCreateDatabaseFromProject" visible="false"/>
<control idMso="FileOpenDatabase" visible="false"/>
<control idMso="FileSave" visible="false"/>
<control idMso="ConvertDatabaseFormat" visible="false"/>
<control idMso="FileSaveAsMenuAccess" visible="false"/>
<control idMso="FileManageMenu" visible="false"/>
<control idMso="FileSendAsAttachment" visible="false"/>
<control idMso="MenuPublish" visible="false"/>
<control idMso="FileServerMenu" visible="false"/>
<control idMso="FileCloseDatabase" visible="false"/>
<button idMso="FileCompactAndRepairDatabase" visible="false"/>
<button idMso="ApplicationOptionsDialog" enabled="false"/>
</officeMenu>
</ribbon>
</customUI>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
For recent files try calling
_WordInstance.DisplayRecen tFiles = False
where _WordInstance is of type Word.Application
I'm not sure if it removes all functionality but it takes them off the office button so users can't just click on them.
_WordInstance.DisplayRecen
where _WordInstance is of type Word.Application
I'm not sure if it removes all functionality but it takes them off the office button so users can't just click on them.
Thanks