Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Password protect files
Is there a way to password protect a whole group of Word files all at one
time with the same password instead of having to open each file and apply password protection? |
#2
|
|||
|
|||
You can do this with a macro e.g.
Public Sub PasswordAll() Dim FirstLoop As Boolean Dim myFile, Password, PathToUse As String Dim myDoc As Document Dim Response As Long PathToUse = "D:\My Documents\Test\Merge\" sPassword = InputBox("Enter Password") On Error Resume Next Documents.Close Savechanges:=wdPromptToSaveChanges FirstLoop = True myFile = Dir$(PathToUse & "*.doc") While myFile "" Set myDoc = Documents.Open(PathToUse & myFile) If FirstLoop Then With ActiveDocument .Password = sPassword .WritePassword = sPassword End With FirstLoop = False Response = MsgBox("Do you want to process " & _ "the rest of the files in this folder", vbYesNo) If Response = vbNo Then Exit Sub Else With ActiveDocument .Password = sPassword .WritePassword = sPassword End With End If myDoc.Close Savechanges:=wdSaveChanges myFile = Dir$() Wend End Sub Change the path to that where you have stored the documents. Practice with *copies* of the documents and set the backup option to be on the safe side until you are happy this works for you. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org mam1413 wrote: Is there a way to password protect a whole group of Word files all at one time with the same password instead of having to open each file and apply password protection? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
protect folders and not just files | Microsoft Word Help | |||
Password Protect Documents | Microsoft Word Help | |||
Keep password protected Word files from being read by Google Desk. | Microsoft Word Help | |||
How to password protect a bunch of Word document files at once? | New Users | |||
Password protect documents | Microsoft Word Help |