Solved

Disable Save/Save As

Posted on 2014-03-25
7
533 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
This video teaches the viewer how to align pictures around text while keeping the text properly aligned in the document.

746 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

13 Experts available now in Live!

Get 1:1 Help Now