Tuesday, February 16, 2021

Lotus domino's script to move mails form one folder to another based on conditions

Lotus domino's script to move mails from one folder to another based on conditions



//Below LotusScript agent move mails to specified
folder



Sub Initialize 
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim document As NotesDocument
Set db = session.CurrentDatabase
Set view = db.GetView( "($Sent)" )
Messagebox "The view is set to sent items"
Dim folder As String
folder = "ICCArchive/Sent Items"

Set document = view.GetFirstDocument
If document.HasItem("Subject") Then
While Not(document Is Nothing)
Forall subject In document.GetItemValue("Subject")
If subject Like "financial*" Then
Messagebox subject
Call document.PutInFolder(folder)
End If
End Forall
Set document = view.GetNextDocument(doc)
End While
End If

End Sub

No comments:

Post a Comment