Hab erst jetzt Deine Antworten gesehen.
PS: Eine praktikable userfreundliche Lösung ist das allerdings nicht...
OK, here you go ;)
Sub Initialize
On Error Goto ERRORHANDLER
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim item As NotesItem
Dim vDeleteItems As Variant
Dim strMsg As String
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
If collection.Count <1 Then
Msgbox "Um diese Aktion auszuführen, muss mind. 1 Dokument ausgewählt sein.", 48, "Kein Dokument ausgewählt"
Exit Sub
End If
'Are you sure???
strMsg = "Du hast " & collection.Count & " Dokument(e) ausgewählt." & Chr(10) _
& "Möchtest Du wirklich diese Dokument(e) bereinigen?"
If Not Messagebox (strMsg,1 + 32,db.title) = 1 Then Exit Sub
Set doc = collection.GetFirstDocument
'-----> Items to remove
Redim vDeleteItems(20)
vDeleteItems(0) = "$FILE"
'........and so on.........
'<-----
While Not(doc Is Nothing)
Forall i In vDeleteItems
While (doc.HasItem(i))
Set item = doc.GetFirstItem(i)
Call item.Remove
Call doc.Save(True, True)
Wend
End Forall
Set doc = collection.GetNextDocument(doc)
Wend
Msgbox collection.Count & " E-Mails wurden bereinigt.", 64, db.Title
EXIT_SCRIPT:
Exit Sub
ERRORHANDLER:
Msgbox "Error: " & Err & " - " & Error$ & Chr(10) & Chr(10)_
& "Procedure: Agent 'Bereinige E-Mails'"& Chr(10) & Chr(10)_
& "Line: " & Erl & Chr(10), _
48, "An error occured"
Resume EXIT_SCRIPT
End Sub
Kopiere den Code in einen Agenten (Trigger: On Event, Target: All selected docs).
Habs gerade in einer Mail-DB getestet: Klappt wunderbar, löscht gnadenlos alle $FILE - Items der ausgewählten Dokumente.
Macht dann 1 Bier, bitte ;D
Y Y
Prost,
Matthias