Reset permissions on outlook folders using VBA
On May 27, 2009,
in Programming,
by Mike Hudson
Using the Redemption object you can use the following code to reset the permissions on a folders sub folders in outlook to leave the Default permissions.
Handy if you need to reset permissions on large numbers of folders.
Sub scall()
Dim TopFolder
Set mySession = CreateObject("Redemption.RDOSession")
mySession.Logon
Set TopFolder = mySession.PickFolder
For i = 1 To TopFolder.Folders.Count
Debug.Print ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>> " & TopFolder.Folders(i).Name
For Each ace In TopFolder.Folders (i).ACL
Debug.Print ace.Name & " - " & ace.rights
If ace.Name "Default" Then
ace.Delete
Debug.Print ">>>>>>>>>>>>>>>
Deleted " & ace.Name
Else
If ace.rights > 0 Then
ace.rights = 0
Debug.Print "<<<<<<<<<<<<<<< Rights Reset"
Else
Debug.Print "< Rights default"
End If
End If
Next
Next
End Sub
About the author
Mike Hudson
Mike Hudson is a Systems engineer living and working in Kingston Upon Hull. With extensive experience in Microsoft and Apple technologies, ranging from desktop OS’s to Server OS’s and hardware. By day working as part of an infrastructure team, and by night ridding the world of IT issues through blog posts..










