Microsoft Word 2007 Disable Save As
-
Thursday, March 06, 2008 4:42 AM
Hi.
I'm developing a Microsoft Word template. When the user saves I'm writing all data in contentcontrols to a database. I don't want the user to be able to use Save As option, or to export the document. Is there a way to disable this? or to prevent users to use this options?
All Replies
-
Thursday, March 06, 2008 7:10 AMModerator
There are two possible approaches available to you
1. You can customize the Ribbon for the template. In the Ribbon XML you list the commands you want to repurpose in the <commands> element. In your case, the idMso values are FileSave and FileSaveAs. See also this article
http://msdn2.microsoft.com/en-us/library/bb462633.aspx
2. Trap the DocumentBeforeSave event and set its Cancel argument to True (you shouldn't need to do anything else). References on working with events:
http://support.microsoft.com/kb/302817/ (C#) or http://support.microsoft.com/kb/302816/ (VB.NET)
-
Sunday, March 09, 2008 4:32 AM
Yes, setting cancel on true was the way to do it, I haven't already prove how it works if the user tries to Export the file since I've been very bussy this week solving another issues, but it does cancel Save As option
Thanks a lot for the answer.

