View Single Post
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor
 
Posts: n/a
Default Groups of Word Files

You can protect a group of Word files in a folder individually using a
macro. The macro uses the folder
D:\My Documents\Test\Merge\
but you can change that to your choice either in the macro or by entering it
at the prompt.
http://www.gmayor.com/installing_macro.htm
DON'T FORGET THE PASSWORD!!!


Public Sub PasswordAll()

Dim FirstLoop As Boolean
Dim myFile As String
Dim Password As String
Dim PathToUse As String
Dim myDoc As Document
Dim Response As Long

PathToUse = InputBox("Path To Use?", "Path", _
"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


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Mike McLellan wrote:
How can I password protest a group of Word documents? Can I apply a
password at the folder level (if so, how?) or do I need to password
protect each individual file?