Solved

Disable saving of Word Document

Posted on 2004-04-02
10
6,094 Views
Last Modified: 2007-12-19
How do you disable saving of a Microsoft Word Document.  I have a document that I want be able to read and write to but I don't want anyone to be able to save over that document.


0
Comment
Question by:aedean
10 Comments
 
LVL 44

Expert Comment

by:CrazyOne
ID: 10745594
One way is to find where it is located on the disk and right click on it and make sure the box marked read only is checked.
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 10745601
From words help

Prompt to open a file as read-only
You can suggest, but not require, that users open a document as read-only. If a user opens the document as read-only and changes it, that person can save the document only by giving it a different file name.

On the Tools menu, click Options.
Click Security.
Select the Read-only recommended check box, and then click OK.
Click Save.
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 10745604
Prompt to open a file as read-only
You can suggest, but not require, that users open a document as read-only. If a user opens the document as read-only and changes it, that person can save the document only by giving it a different file name.

On the Tools menu, click Options.
Click Security.
Select the Read-only recommended check box, and then click OK.
Click Save.
0
 
LVL 17

Accepted Solution

by:
smozgur earned 500 total points
ID: 10752572
We can restrict application to save that document by catching the application's documentbeforesave event if it is a document that you can (or would like to)  use VBA. First we need the Word Application object events that is not available as default so we create the wApp object in Document_Open event of our document (wApp is the object that we declared by using Withevents keyword to get its events into our class module, see the code please).

Open your document, goto VBA (Alt+F11), see project explorer (Ctrl+R) and double click on the Thisdocument object under Microsoft Word Objects of your document in project explorer. And copy and paste the following code into the module opened at right pane.

'-----Code Start----
Dim WithEvents wApp As Application

Private Sub Document_Open()
    Set wApp = Application
End Sub

Private Sub wApp_DocumentBeforeSave(ByVal Doc As Document, SaveAsUI As Boolean, Cancel As Boolean)
    'If the document that is being saved is our document (verifying name) then cancel the save operation
    If Doc.Name = ThisDocument.Name Then Cancel = True
End Sub
'----Code End-----

I hope this helps.
Suat
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 10758502
Why not just save the document as a template?  Then they can do File/New and access it.  
0
 
LVL 7

Expert Comment

by:rosesolutions1
ID: 10804502
Are you sure you want to allow other people to save changes to the file?
The built in Word mechanism that most closely resembles what you have asked is to apply a password for modifying the file (Tools/Options/Security tab).
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 10817890
Why would anyone take the time to open a document, revise it (write to it) and then not be able to save it.  It doesn't make sense.  If you want the document available for use by others with the original to remain intact, again, save it as a template and make it available under file/new.
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 10849050
Templates are nice but may not meet the current requirements that aedean is asking for. Sometimes there is more than meets the eye.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

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

16 Experts available now in Live!

Get 1:1 Help Now