| |
| Sub Click(Source As Button) |
| |
| 'Allgemeine Variablen |
| Dim Session As New notessession |
| Dim Confirm As Integer |
| Dim Count As Integer |
| Dim CountOK As Integer |
| Dim CountER As Integer |
| Dim CountShow As String |
| Dim CountOKShow As String |
| Dim CountERShow As String |
| Dim PerformAclChenges As Integer |
| Dim ActionStatus As String |
| Dim NewAclLevel As Long |
| |
| 'Variablen für Names.nsf |
| Dim NamesDB As NotesDatabase |
| Dim NamesView As NotesView |
| Dim NamesDOC As NotesDocument |
| Dim NamesFileName As String |
| Dim NamesServerName As String |
| Dim NamesViewName As String |
| |
| 'Variablen für Maildatenbank aus der Names.nsf |
| Dim NamesMailFileName As Variant |
| Dim NamesMailFileOwner As Variant |
| Dim NamesMailFileMailServer As Variant |
| Dim NamesMailFileMailLastName As Variant |
| Dim NamesMailFileMailFirstName As Variant |
| |
| 'Variablen für Maildatenbank des Users |
| Dim MailFileDB As NotesDatabase |
| |
| ' * * * Konfiguration * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
| 'Füllen der Variablen für Names.nsf |
| namesFileName="names.nsf" |
| NamesServerName="demo01/springfield" |
| NamesViewName="($PEOPLE)" |
| PerformAclChanges="0" |
| 'Editor: ACLLEVEL_EDITOR |
| 'Manager: ACLLEVEL_MANAGER |
| NewAclLevel&=ACLLEVEL_EDITOR |
| ' * * * Konfiguration * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
| |
| Print "..........................................................................." |
| |
| 'Öffnen des NAB |
| Set NamesDB = Session.GetDatabase(NamesServerName, NamesFileName) |
| Set NamesView = NamesDB.GetView(NamesViewName) |
| Set NamesDOC = NamesView.GetFirstDocument |
| |
| 'Durchlauf durch alle Personendokument im NAB |
| Do Until NamesDOC Is Nothing |
| |
| 'Counter gesamt |
| count=count+1 |
| CountShow=count |
| |
| 'Auslesen der Variablen aus dem Personendokument des NAB |
| NamesMailFileName=NamesDOC.MailFile |
| NamesMailFileOwner=NamesDOC.FullName |
| NamesMailFileMailServer=NamesDOC.MailServer |
| NamesMailFileMailLastName=NamesDOC.LastName |
| NamesMailFileMailFirstName=NamesDOC.FirstName |
| |
| 'Öffnen der Maildatei des jeweiligen Personendokuments |
| If ( PerformAclChanges = 1 And Len(NamesMailFileName(0))>1 And Len(NamesMailFileOwner(0))>1 And Len(NamesMailFileMailServer(0))>1 ) Then |
| 'Öffnen der MailFile |
| Set MailFileDB = Session.GetDatabase(NamesMailFileMailServer(0),NamesMailFileName(0)) |
| 'Setzen der neuen ACL |
| Call MailFileDB.GrantAccess( NamesMailFileOwner(0), NewAclLevel& ) |
| ActionStatus="OK" |
| 'Counter OK |
| countOK=countOK+1 |
| CountOKShow=countOK |
| Else |
| ActionStatus="ER" |
| 'Counter ER |
| countER=countER+1 |
| CountERShow=countER |
| End If |
| |
| Print CountShow+": "+ActionStatus+": "+NamesMailFileMailLastName(0)+", "+NamesMailFileMailFirstName(0)+" - "+NamesMailFileOwner(0)+" - "+NamesMailFileName(0)+" - "+NamesMailFileMailServer(0) |
| Set NamesDOC = NamesView.GetNextDocument(NamesDOC) |
| Loop |
| |
| Print "..........................................................................." |
| Print( "Gesamt:"+CountSHow+"; OK:"+CountOKShow+"; Fehler: "+CountERShow+" (Weitere Infos in der Statusbar)") |
| Messagebox( "Gesamt:"+CountSHow+"; OK:"+CountOKShow+"; Fehler: "+CountERShow+" (Weitere Infos in der Statusbar)") |
| |
| |
| End Sub |
| |