Password protect multiple documents at once?

S

Steve Thompson

Is there a way to add the same password to a large number of Word 2003 and/or
Excel 2003 documents at once? Either in Office or through a third-party
utility?

Thanks.
 
H

Harlan Grove

Steve Thompson said:
Is there a way to add the same password to a large number of Word 2003 and/or
Excel 2003 documents at once? Either in Office or through a third-party
utility?

Protect in what sense? Passwords that would need to be entered to open
files? Passwords that would need to be entered to save modifications
to the files? Passwords that would supposedly prevent modifications to
the files?

Whichever, it could be done using macros, but depending on the
underlying intent, it may be more practical to put all these files
into a password-protected .ZIP file.
 
S

Steve Thompson

Harlan Grove said:
Protect in what sense? Passwords that would need to be entered to open
files? Passwords that would need to be entered to save modifications
to the files? Passwords that would supposedly prevent modifications to
the files?

Whichever, it could be done using macros, but depending on the
underlying intent, it may be more practical to put all these files
into a password-protected .ZIP file.

I want to set password that would need to be entered to open the files. How
could I do this with a macro?

(A .ZIP file isn't really viable, as it would just confuse some of the
people who need access to the files and be somewhat inconvenient.)

Thanks.
 
B

Bob I

Steve said:
:




I want to set password that would need to be entered to open the files. How
could I do this with a macro?

(A .ZIP file isn't really viable, as it would just confuse some of the
people who need access to the files and be somewhat inconvenient.)

Thanks.

I think you will need to use something like AutoIT to do this reasonably
quickly. It is free (donations accepted) at the authors website(google
AutoIt)
 
H

Harlan Grove

Bob I said:
I think you will need to use something like AutoIT to do this reasonably
quickly. It is free (donations accepted) at the authors website(google
AutoIt)

Maybe for Word (though I doubt it, but I'm not inclined to check), but
definitely not for Excel. Far more reliable to use a VBA macro in
Excel. The following macro assumes it's located in Personal.xls or
some other macro library file which should NOT be saved with a
password, all other open workbooks have already been saved before and
should be resaved/overwritten with file open passwords.


Sub foo()
Const PW As String = "common password here"

Dim k As Long

For k = 1 To Workbooks.Count
If Workbooks(k).FullName = ThisWorkbook.FullName Then GoTo
Continue

With Workbooks(k)
.SaveAs FileName:=.FullName, Password:=PW
End With

Continue:

Next k

End Sub


This could be modified to read a list of filenames in a cell range,
open those files, then resave with passwords. This would also likely
be faster AND more robust done in either Excel or Word and NOT using
generic 3rd party mouse and keyboard macro tools.
 
Top