Skript zum Löschen aus der gesendeten Ansicht Lotus Notes nach Datum

362
Thierry

Weiß jemand, wie man das folgende Skript zum Löschen aus der gesendeten Ansicht nach dem angegebenen Datum ändert. Nachfolgend finden Sie das iBM-Standardskript, das nach Datum und nicht nach Tagen gelöscht werden muss. Grundsätzlich brauche ich ein Skript, das alle gesendeten Mails vor einem bestimmten Datum löscht. Jede Hilfe wäre dankbar.

Sub Initialize Dim s As New NotesSession Dim db As NotesDatabase Dim view As NotesView Dim doc As NotesDocument Dim nextdoc As NotesDocument Dim lastmodifieddate As New NotesDateTime("") Dim modifieddate As Variant Dim days As Integer  Set db = s.CurrentDatabase Set view = db.GetView("$Sent") Set doc = view.GetFirstDocument  While Not ( doc Is Nothing ) Set nextdoc = view.getnextdocument(doc) modifieddate=Evaluate("@Modified", doc) lastmodifieddate.lslocaltime= CDat(modifieddate(0)) days = CInt( Date - lastmodifieddate.lslocaltime ) 'Change the number of days from 30 below as desired If days > 30 Then  Call doc.Remove(True) 'In Notes 6.0 and later you can use the below instead of the above  'if you want to hard delete the document 'Call doc.RemovePermanently(True) End If  Set doc = nextdoc  Wend  End Sub 
0

1 Antwort auf die Frage

0
notesbuddy

so etwas sollte funktionieren

Sub Initialize Dim s As New NotesSession Dim db As NotesDatabase Dim view As NotesView Dim doc As NotesDocument Dim nextdoc As NotesDocument Dim lastmodifieddate As New NotesDateTime("") Dim modifieddate As Variant Dim days As Integer  Dim checkdate as Variant  Set db = s.CurrentDatabase Set view = db.GetView("$Sent") Set doc = view.GetFirstDocument  checkdate = DateNumber(2018, 02, 25)  While Not ( doc Is Nothing ) Set nextdoc = view.getnextdocument(doc) modifieddate=Evaluate("@Modified", doc)  If modifieddate < checkdate Then  Call doc.Remove(True) 'In Notes 6.0 and later you can use the below instead of the above  'if you want to hard delete the document 'Call doc.RemovePermanently(True) End If  Set doc = nextdoc  Wend  End Sub