Detect Meeting Responses

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,
 
S

Sue Mosher [MVP-Outlook]

Don't Dim EMail as MailItem. Dim it as Object and check its Class property. If it's olMail, then proceed to process it as a MailItem.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
R

Rod Gill

Thanks Sue, I'll give that a go.

--

Rod Gill

Don't Dim EMail as MailItem. Dim it as Object and check its Class property.
If it's olMail, then proceed to process it as a MailItem.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top