R
Rod Gill
Hi,
I can successfully loop thru all messages in the Sent Items folder until the
code reaches a Meeting Response item. At that point there is a type
conflict. How can I detect a meeting response so I can ignore it and
continue with the loop?
Code below is passed Fldr already ponting to Sent Items and a recordset thru
which information is being saved to a database.
Sub SaveSentEmails(Fldr As MAPIFolder, rs As ADODB.Recordset)
Dim Email As MailItem
Dim Emails As Items
On Error Resume Next
With rs
For Each Email In Fldr.Items
'Only save future appointments
If Not Email Is Nothing Then
If Email.SentOn > LastDate Then
.AddNew
!FolderName = Fldr.Name
!Sent = Email.SentOn
!Subject = Left$(Email.Subject, 98)
!To = Left$(Email.To, 50)
!Details = Email.Body
!DateAdded = Date
If Err > 0 Then
Beep
End If
.Update
End If
End If
Next
End With
End Sub
Many Thanks,
I can successfully loop thru all messages in the Sent Items folder until the
code reaches a Meeting Response item. At that point there is a type
conflict. How can I detect a meeting response so I can ignore it and
continue with the loop?
Code below is passed Fldr already ponting to Sent Items and a recordset thru
which information is being saved to a database.
Sub SaveSentEmails(Fldr As MAPIFolder, rs As ADODB.Recordset)
Dim Email As MailItem
Dim Emails As Items
On Error Resume Next
With rs
For Each Email In Fldr.Items
'Only save future appointments
If Not Email Is Nothing Then
If Email.SentOn > LastDate Then
.AddNew
!FolderName = Fldr.Name
!Sent = Email.SentOn
!Subject = Left$(Email.Subject, 98)
!To = Left$(Email.To, 50)
!Details = Email.Body
!DateAdded = Date
If Err > 0 Then
Beep
End If
.Update
End If
End If
Next
End With
End Sub
Many Thanks,