Link to home
Start Free TrialLog in
Avatar of felice_minervino
felice_minervino

asked on

Disable Save/Save As

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.
Avatar of Dennis Aries
Dennis Aries
Flag of Netherlands image

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
@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
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

ASKER CERTIFIED SOLUTION
Avatar of Theo Kouwenhoven
Theo Kouwenhoven
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of felice_minervino
felice_minervino

ASKER

ok thanks Murph !!

i will study your suggestion.

regards
Felice
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!