Hi,
das ist der Code (bin allerdings nicht der erfahrenstes Script-Progger
) :
Dim s As New NotesSession
Dim db As NotesDatabase
Dim directory As NotesDbDirectory
Dim uniqid As String
Dim count,count2,count3,count4 As Integer
Dim emaildbs As String
Dim okay, fehler As String
Dim dbPath, MailPath, dbName, ViewName, CorrectedViews As String
Set directory = New NotesDbDirectory ("SERVER")
Set db = directory.GetFirstDatabase(DATABASE)
While Not (db Is Nothing)
dbPath = db.FilePath
dbName = dbPath
MailPath = Left(dbPath, 13)
If MailPath = "SERVER!!mail\" Then
While dbPath <> ""
count = 0
count2 = 0
count3 = 0
count4 = 0
If Not db.IsOpen Then
Call db.Open( "", "" )
On Error Goto Errorhandle
End If
CorrectedViews = ""
Forall Views In db.Views
If Views.IsFolder Then
ViewName = Views.Name
count = count + 1
uniqid = Views.UniversalID
Set doc = db.GetDocumentByUNID(uniqid)
Set flags = doc.GetFirstItem("$Flags")
If ViewName = "($Inbox)" Or ViewName = "($Trash)" Or ViewName = "($Alarms)" Then
If (flags.Text Like "*P*") Then
Dim flagziel As String
Call GPRKFindAndReplace(flags.Text, flagziel, "P", "")
flags.Values = flagziel
Call doc.Save(True, False)
count3 = count3 + 1
End If
Else
If Not (flags.Text Like "*P*") Then
flags.Values = flags.Text & "P"
Call doc.Save(True, False)
count2 = count2+1
CorrectedViews = CorrectedViews & ViewName
Else
count4 = count4+1
End If
End If
End If
End Forall
dbPath = ""
Wend
Dim text As String
text = "blabla"
Dim mdb As New NotesDatabase ("","mail.box")
Dim d As notesdocument
Set d = New notesdocument(mdb)
d.form = "Memo"
d.Subject = "FolderProtect für " & Cstr(dbName)
d.Body = text
d.SendTo = "lnadmin"
Call d.send(False)
End If
Weiter:
Set db = directory.GetNextDatabase
Wend
Exit Sub
Errorhandle:
Print "Fehler bei Datenbank : " & Cstr(dbName)
Print "Fehler " & Str(Err) & " : " & Error$
Goto Weiter
End Sub