How to get all lotus notes message in 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?

Public Function checkEmail() As String
        Dim returnNoteID As String = Nothing
        Dim subj() As String
        Dim cats() As String
        Dim nDateTime As NotesDateTime = domS.CreateDateTime("")
        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(" ~ ")
                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)) )
            End If
            domDoc = dc.GetNextDocument(domDoc)
            If domDocDel Is Nothing = False Then
            End If
        End While
        domDoc = Nothing
        domVE = Nothing
        domVN = Nothing
        domV = Nothing
        Return returnNoteID
    End Function

Open in new window

Who is Participating?
HobolyConnect With a Mentor Author Commented:
Thanks~ how about searching only in subject?
SysExpertConnect With a Mentor Commented:
I would look into the search or FTSearch  ( assumes full text indexing )

Other methods are similar to yours, but if you know how the view is sorted ( by date acending or descending ), then you can save a lot of time.

I hope this helps !
HobolyAuthor Commented:
no complete solution for too long
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.