• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1664
  • Last Modified:

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

0
Hoboly
Asked:
Hoboly
  • 2
2 Solutions
 
SysExpertCommented:
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 !
0
 
HobolyAuthor Commented:
Thanks~ how about searching only in subject?
0
 
HobolyAuthor Commented:
no complete solution for too long
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now