Solved

Mine / Search Outlook messages from Access 2013

Posted on 2013-06-20
1
355 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
Many people use more than one email account and so it becomes difficult for them to manage them when they use separate accounts,  so, in this article, I have shared an easy way to add Other Mail Accounts in your Google Inbox. It helps to combine all…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

813 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now