как то так должно работать
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