PDA

View Full Version : Disable Read Only when document opens using VBA



FeelGoodLost
08-12-2008, 12:28 PM
I have an application that needs to go through about 1000 word documents in a folder and modify them all slightly. It works well on 80 percent of them, but the other 20% have had the "Read Only Recommended" box checked under Options - Security in Word2003. I need to disable read only when the document opens. I've tried these lines of code, yet it will still open saying (READ ONLY) in the title bar and won't let me save(!):



Set MyDocument = Documents.Open(FileName:=.FoundFiles(lCount), ReadOnly:=False)
MyDocument.Protect wdNoProtection
SetAttr MyDocument.Path, vbNormal


any help would be soooo appreciated. :banghead:

antonc
10-27-2008, 12:35 AM
Hi,

I'm also looking for help to a similar problem.

I have used VBA to open certain read-only files, but I always get the prompt telling me that is is a readonly file.

Is there any way that I can suppress this? I don't want to see the prompt at all?

Any help would be appreciated...

Thanks in advance

Nelviticus
10-27-2008, 04:58 AM
This should do it:

Documents.Open FileName:="MyFileName", ReadOnly:=False
Regards
*edit: well, I've just tried it in Word 2007 with two documents, one of which was marked 'read only recommended'. Both opened without prompts and neither were marked 'read only' in the title bar.