Unable to save encrypted file

J

John A

Recently I have been unable to save changes to encrypted docx files, unless I
saveAs a different file.

What happens is that the Save dialog box comes up then it says it is unable
to save due to permissions error.

Is there a way to save these files direclty?

Thank you

Word 2007, XP SP3, Miocrosoft Security Essentials
 
G

Graham Mayor

By encrypted, do you mean that the document is password protected against
editing? That being the case what you are experiencing is normal behaviour.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Graham Mayor

You can work around the issue with a macro that reproduces the steps needed
to change with a new name and replace the old file with the new one eg

Sub RemoveReadOnlyPassWord()
Dim oldName As String
Dim newName As String
'Record the document name and path
oldName = ActiveDocument.FullName
'Save with a temporary file name without passwords
ActiveDocument.SaveAs FileName:=ActiveDocument.Path & "\Temp.docx", _
Password:="", WritePassword:="", ReadOnlyRecommended:=False
'record the new name
newName = ActiveDocument.FullName
'The lock file is now released so you can
'save the new doc with the old name
ActiveDocument.SaveAs old name
'Remove the file with the old name
Kill newName 'optional
End Sub

http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

John A

Thanks Graham

I have the document encrypted with Password to Open set. If I enter the
correct password, I would expect to be able to modify the document and save
it. That seems to be what is implied in the Word tutorial on this.
 
J

John A

Thanks for the code - that is very useful.

Graham Mayor said:
You can work around the issue with a macro that reproduces the steps needed
to change with a new name and replace the old file with the new one eg

Sub RemoveReadOnlyPassWord()
Dim oldName As String
Dim newName As String
'Record the document name and path
oldName = ActiveDocument.FullName
'Save with a temporary file name without passwords
ActiveDocument.SaveAs FileName:=ActiveDocument.Path & "\Temp.docx", _
Password:="", WritePassword:="", ReadOnlyRecommended:=False
'record the new name
newName = ActiveDocument.FullName
'The lock file is now released so you can
'save the new doc with the old name
ActiveDocument.SaveAs old name
'Remove the file with the old name
Kill newName 'optional
End Sub

http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Graham Mayor

If you know the password for editing the document and enter it on opening
the document, then you can use SaveAs and from the saveas dialog > tools >
general > remove the password > OK. It should then save without the
password. The macro is for those occasions when you don't know the editing
password.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

John A

Great, thanks Graham

Graham Mayor said:
If you know the password for editing the document and enter it on opening
the document, then you can use SaveAs and from the saveas dialog > tools >
general > remove the password > OK. It should then save without the
password. The macro is for those occasions when you don't know the editing
password.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top