Solved

Mine / Search Outlook messages from Access 2013

Posted on 2013-06-20
1
356 Views
Last Modified: 2013-07-28
I have a Microsoft Access 2013 application.  I want to be able to dynamically access my Outlook email and search for keywords and return the results into a table that I can then format and report on.  Is there a way to do this via an API from VBA?  The scenario is that I get emails that are formatted a specific way with subject line content.  I need to be able to mine this data.
0
Comment
Question by:4GvnNot4Gotn
1 Comment
 
LVL 48

Accepted Solution

by:
PortletPaul earned 500 total points
ID: 39267974
maybe these will assist?

an Excel example "retrieve e-mails from the Inbox and list them on the ActiveSheet" http://www.dicks-clicks.com/excel/olRetrieving.htm

(access, Jun 2011) a small piece of VBA here that may get you started:
http://www.access-programmers.co.uk/forums/showthread.php?t=212530
and another here (May 2008)
http://www.access-programmers.co.uk/forums/showthread.php?t=149252

& an article (but dated 2007) at techrepublic discusses Outlook to Access with some VBA
How do I... Export Outlook e-mail messages to Access using VBA?
 (copyrigthed so I can't post it) techrepublic requires registration
but I can quote (part) of it
Set adoConn = CreateObject("ADODB.Connection")
 Set adoRS = CreateObject("ADODB.Recordset")
 'DSN and target file must exist.
 adoConn.Open "DSN=OutlookData;"
 adoRS.Open "SELECT * FROM email", adoConn, _
 adOpenDynamic, adLockOptimistic
 'Cycle through selected folder.
 For intCounter = objFolder.Items.Count To 1 Step -1
 With objFolder.Items(intCounter)
 'Copy property value to corresponding fields
 'in target file.
 If .Class = olMail Then
 adoRS.AddNew
 adoRS("Subject") = .Subject
 adoRS("Body") = .Body
 adoRS("FromName") = .SenderName
 adoRS("ToName") = .To
 adoRS("FromAddress") = .SenderEmailAddress
 adoRS("FromType") = .SenderEmailType
 adoRS("CCName") = .CC
 adoRS("BCCName") = .BCC
 adoRS("Importance") = .Importance
 adoRS("Sensitivity") = .Sensitivity
 adoRS.Update
 End If
 End With
 Next
 adoRS.Close
http://www.techrepublic.com/downloads/how-do-i-export-outlook-e-mail-messages-to-access-using-vba/308982/post?tag=mantle_skin;content
more from this source on the access-side:
You can also work with an existing database. In that case, add a new table named email with the appropriate fields, which should all be text fields except for Body, which requires a Memo field. The field names in the Access table aren’t predefined; you can name them anything you like. This code uses the field names generated by the Import And Export wizard. The e-mail properties are predefined. You can get those from the code listing. Name the table anything you like, but be sure to update the Recordset object’s Open method statement appropriately.
NB The full macro code allows for selection of an Outlook folder for this export

 " Is there a way to do this via an API from VBA?  "
looks like yes

perhaps others with more direct experience in this  may be able to add more for you.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question