PDA

View Full Version : Can I get Word 2007 to warn me when a document is opened read only?



Jason101
03-23-2014,
From time to time, when I open a Word document, it is opened read only. I have no idea why this happens. It is fairly infrequent (3-4 times a month) and seems random.



The problem is that I don't notice that it's read only, so I go about merrily on editing the document. When I try to save it, I get the Save As dialog. In then have to save it under a different name, delete the old copy, and rename the new one. In addition to a royal pain, it screws up my archive log.



Is there a way that I can have Word warn me whenever a document is opened read only?



Thanks

BeLikeWater
03-27-2014,
I did a little more research and found this website:



http://stackoverflow.com/questions/12630878/word-vba-document-readonly-status-incorrectly-returns-false

It has a document_open macro which I adapted as follows:

Sub Document_Open()
If ThisDocument.ReadOnly = False Then Exit Sub
MsgBox "This document is read only."
'UserForm1.Show
End Sub

I saved it in a Normal code module and set a breakpoint. It does get executed every time a document is opened, but the readonly test is always False, even when the document has the Read Only flag set and the title bar clearly says "(Read Only)".



Is there a way to modify this macro so that the MsgBox statement will execute when a document is opened read only?