Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How can I remove/disable the Office Button from MS Word 2007?

Posted on 2008-06-10
3
Medium Priority
?
3,338 Views
Last Modified: 2012-04-20
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.
<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>

Open in new window

0
Comment
Question by:guxiyou
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Accepted Solution

by:
guxiyou earned 0 total points
ID: 21793888
Well, it looks like nobody has a really great answer to this problem.  I guess I'll just post on what I found.  

1) When using the DsoFramer Control provided by, but not supported by, Microsoft; the Office button is removed.  This indicates that there IS some way to do it, but that it may not be a very simple or straight-forward way.  

2) There doesn't appear to be a way to do it using the custom user interface xml that is stored within the docx file.

3) The recent documents also don't appear to be able to be removed or disabled from the xml embedded in the docx file.

4) A work around (although a dangerous one) is available for instances of word that are embedded in applications.  You can simply save the recent documents, set the max number of recent documents to zero (effectively removing them), and then restoring recent documents when you are done using the instance of word.  This works well, but is not entirely save because if an application is terminated early it may lead to losing the users recent document list, and to leaving it set to not saving the recent documents)
0
 

Expert Comment

by:esps
ID: 23999737
Can you please post an example of how the XML is implimented?

Thanks
0
 

Expert Comment

by:PaperlessEnvironments
ID: 37873708
For recent files try calling

_WordInstance.DisplayRecentFiles = 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.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question