Currently I am writing a Lotus Notes Automation Client (Freely named here). It's purpose is to grab the body of Emails that are coming in through a certain account and parse them out.
additional info:
- App is not running on the server
- Tried the unprocesseddocuments (No beans - Server only)
Currently I am using the Delivereddate and the LastModified date to see if the email is new.(see code) this works but when someone goes into the account and reads and email (even if they set if back markasunread) , because the last modified date changes, the client wont pick up the Email.
So the Questions are:
1. Is there a way to find out whether or not a document has been read
2. What folder a document residing in.
Any additional question ask here or Email to mmthiran@hotmail.com
(since it a 2 parter I'll set it to 200 pts.
Here is the raw code bit ....
Dim colMailItems As NotesDocumentCollection
Dim docMailItem As NotesDocument
Dim NoteMailItem As NoteItem
Dim NotesMailItem As NotesItem
Dim NotesMailItem2 As NotesItem
Dim strPartSql As String
Dim NumberOfMessages As Long
On Error GoTo errhandler
Set colMailItems = Maildb.AllDocuments
Set docMailItem = colMailItems.GetLastDocume
nt
'Set NoteMailItem = docMailItem
NumberOfMessages = colMailItems.Count
For lngItem = 0 To NumberOfMessages - 1
Set NotesMailItem = docMailItem.GetFirstItem("
Subject")
Set NotesMailItem = docMailItem.GetFirstItem("
dateLastMo
dified")
If NotesMailItem.Text = "*** Danka Lost Customers ***" Then
If DateDiff("s", docMailItem.LastAccessed, NotesMailItem2.Text) >= 0 Then 'Compare to see if Email Item is new
Set NotesMailItem = docMailItem.GetFirstItem("
Body") 'Get Body Item
strPartSql = parse_email(NotesMailItem2
.Text) 'Parse_email returns the Partial Sqlstring extracted from the body
insert_in_sqldb (strPartSql) 'The partial Sql string is used to Updatet the Database
DoEvents
'docMailItem.AppendItemVal
ue "Subject", "Processed *** Danka Lost Customers ***"
'docMailItem.Save True, False, True
docMailItem.PutInFolder "Processed" 'Move to Processed Folder
docMailItem.RemoveFromFold
er "Inbox" 'Remove document from inbox
'docmailitem.
'docMailItem
End If
End If
Set docMailItem = colMailItems.GetPrevDocume
nt(docMail
Item)
Next
On Error GoTo 0
Exit Sub
Start Free Trial