Solved

Disable Save/Save As

Posted on 2014-03-25
7
547 Views
Last Modified: 2014-03-31
I wanted to add a addin to Microsoft Word and Powerpoint (2010) in C# and want to programatically disable the SAVE\SAVEAS tab of WORD and POWERPOINT. Could somebody pinpoint sample code.
0
Comment
Question by:felice_minervino
7 Comments
 
LVL 18

Expert Comment

by:Dennis Aries
ID: 39955318
What is your objective? Do you want to remove the items altogether, just disable them (but keep them visible) or alter the functionality?

I think what you are looking for is to be found in altering the Ribbon with CustomUI Editor
0
 
LVL 45

Expert Comment

by:aikimark
ID: 39955645
@Dennis Aries

I have removed a link to an open question on another Q&A site from your comment, http:#a39955318

EE would like its experts to post solutions.  If you get the content from another site, then an attribution link would be expected.

aikimark -- zone advisor
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 39955656
If a VBA macro with the same name as a Word command exists within scope, then the macro will run instead of the command, so if the macro does nothing then the Command is effectively disabled.

Put this code in your a global template such as Normal or one in the Word Startup folder
Sub Save()
End Sub
Sub SaveAs()
End Sub

Open in new window

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 16

Accepted Solution

by:
theo kouwenhoven earned 500 total points
ID: 39955736
Hi Felice,

Graham is almost right, you need to use the FileSave and FileSaveAs  instead of Save and SaveAs.

Then  you have still the Save option on exit, for that you need the FileSaveAll.

Check this document for more detail:
http://word.mvps.org/faqs/macrosvba/interceptsaveprint.htm

Regards,
Murph
0
 

Author Comment

by:felice_minervino
ID: 39956029
ok thanks Murph !!

i will study your suggestion.

regards
Felice
0
 
LVL 23

Expert Comment

by:JSRWilson
ID: 39958515
That approach is not going to fly in PowerPoint from 2007 (and prpbably not in C#)

I would suggest disabling / hiding the commands in XML in the CustomUI folder (assuming thios is an XML based version ie after 2003). This will work in both WORD and POWERPOINT

Just wondering how you are going to save files though!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C# application error "Parameter Is Not Valid". 3 80
Exit the loop 4 39
C# parent child form 5 19
word is recognized as adobe and adobe as IE files 14 20
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

861 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now