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

Posted on 2009-04-22
Last Modified: 2013-11-16
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

Question by:Hoboly
    LVL 63

    Assisted Solution

    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 !

    Accepted Solution

    Thanks~ how about searching only in subject?

    Author Comment

    no complete solution for too long

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

      In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
    Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now