0
Does anyone know how to modify below script to delete from sent view by specified date. Below is the iBM standard script, which needs to be modified to delete by date not days. Basically I need a script that will delete all sent mails before a specified date. Any help would be appreciated.
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