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
 

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

Back
Top