Link to home
Start Free TrialLog in
Avatar of Hoboly
Hoboly

asked on

How to get all lotus notes message in vb.net where subjects contain "ABC"?

How to get messages in inbox based on subject instead of all messages in inbox?

Further more, how to get messaged within one day and with subject containing "ABC" string?

Thanks!
Public Function checkEmail() As String
 
        Dim returnNoteID As String = Nothing
        open()
 
        Dim subj() As String
        Dim cats() As String
 
        Dim nDateTime As NotesDateTime = domS.CreateDateTime("")
        nDateTime.SetNow()
        nDateTime.AdjustMinute(DETECT_EMAIL_WITHIN_MIN)
 
        Dim dc As NotesView = domDB.GetView("($InBox)")
 
 
        domDoc = dc.GetFirstDocument
        Dim ni As NotesItem
        Dim nis() As NotesItem
 
        Dim current_subject As String
        Dim current_starttime As String
        Dim current_endtime As String
 
        Dim domDocDel As NotesDocument
 
 
        While Not (domDoc Is Nothing)
 
            domDocDel = Nothing
 
            current_subject = CStr(domDoc.GetItemValue("Subject")(0))
            current_starttime = current_subject.Replace(sSubjectDetectfilter, "").Trim
 
            If current_subject.IndexOf(sSubjectDetectfilter) > -1 Then
 
                'If Now.Subtract(DateTime.Parse(domDoc.GetItemValue("PostedDate")(0))).TotalMinutes < DETECT_EMAIL_WITHIN_MIN Then
 
                'Dim strs() As String = doc.ColumnValues()
                llog1.write(current_starttime)
                llog1.write(" ~ ")
                llog1.write(CDate(domDoc.GetItemValue("DeliveredDate")(0)).ToString("yyyy-MM-dd HH:mm:ss"))
                llog1.write(" ")
                llog1.write("Result: Successful" + " " +  CStr(domDoc.GetItemValue("Subject")(0)) )
                llog1.writeline("")
 
            End If
 
 
            domDoc = dc.GetNextDocument(domDoc)
            If domDocDel Is Nothing = False Then
                domDocDel.RemoveFromFolder("($InBox)")
 
            End If
 
        End While
 
 
        domDoc = Nothing
        domVE = Nothing
        domVN = Nothing
        domV = Nothing
 
        close()
        Return returnNoteID
 
    End Function

Open in new window

SOLUTION
Avatar of SysExpert
SysExpert
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Hoboly
Hoboly

ASKER

no complete solution for too long