Solved

Disable Save/Save As

Posted on 2014-03-25
7
558 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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…
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

803 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