Скрипт для удаления из отправленного представления Lotus Notes по дате

256
Thierry

Кто-нибудь знает, как изменить приведенный ниже скрипт для удаления из отправленного просмотра к указанной дате. Ниже приведен стандартный скрипт iBM, который необходимо изменить, чтобы удалить по дате, а не по дням. В основном мне нужен скрипт, который удалит все отправленные письма до указанной даты. Любая помощь будет оценена.

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 ответ на вопрос

0
notesbuddy

как то так должно работать

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