Solved

Mine / Search Outlook messages from Access 2013

Posted on 2013-06-20
1
353 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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Email signatures have numerous marketing benefits. Here are 8 top reasons to turn your email signature into a marketing channel.
Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
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 …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

744 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

15 Experts available now in Live!

Get 1:1 Help Now