Extracting Senders name and body of message

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How would I go about extracting the senders name and body of email and import
into an access database table?
 
Hi Kerry,

this sample prints the properties of the first Inbox item into the debug
window (strg-g):

Dim oItems as Outlook.MapiFolder
Dim oMail as Outlook.MailItem
Dim obj as Object

Set oItems=Application.Session.GetDefaultFolder(olFolderInbox).Items

If oItems.Count Then
Set obj=oItems(1)
If typeOf obj Is Outlook.MailItem Then
Set oMail=obj
debug.Print oMail.SenderName, oMail.Body
Endif
Endif

Infos for connecting to a database:
http://www.outlookcode.com/d/database.htm
 
Back
Top