I want Access to read the fresh part of an email but not the old replied content.
What i mean is I want Access to only read the 'fresh' part of the email, for example 33333333333333 in this case.
But I couldn't find a way to do it...sad...
Now I'm thinking if I can let Access only read the first line of an email.
is there any way to do it?
MY CODE:
What i mean is I want Access to only read the 'fresh' part of the email, for example 33333333333333 in this case.
But I couldn't find a way to do it...sad...
Now I'm thinking if I can let Access only read the first line of an email.
is there any way to do it?
MY CODE:
Private Sub ReadInboxDone()
Dim TempRst As DAO.Recordset
Dim rst As DAO.Recordset
Dim OlApp As Outlook.Application
Dim Inbox As Outlook.MAPIFolder
Dim InboxItems As Outlook.Items
Dim Mailobject As Object
Dim db As DAO.Database
Dim dealer As Integer
On Error GoTo ErrorHandler
DoCmd.RunSQL "Delete * from tbl_outlooktempFinish"
Set db = CurrentDb
Set OlApp = CreateObject("Outlook.Application")
Set Inbox = OlApp.GetNamespace("Mapi").GetDefaultFolder(olFolderInbox)
Set TempRst = CurrentDb.OpenRecordset("tbl_OutlookTempFinish")
'
Set InboxItems = Inbox.Items
'
For Each Mailobject In InboxItems
If Mailobject.UnRead Then
With TempRst
.AddNew
!Subject = Mailobject.Subject
!from = Mailobject.SenderName
!to = Mailobject.to
!Body = Mailobject.Body
!DateSent = Mailobject.SentOn
!DateReceived = Mailobject.ReceivedTime
.Update
If Mailobject.Body Like "done*" Then
Mailobject.UnRead = False
Else
Mailobject.UnRead = True
End If
End With
End If
Next
ErrorHandler:
Set OlApp = Nothing
Set Inbox = Nothing
Set InboxItems = Nothing
Set Mailobject = Nothing
Set TempRst = Nothing
End Sub