Solved

Mine / Search Outlook messages from Access 2013

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Suggested Solutions

Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
Read this checklist to learn more about the 15 things you should never include in an email signature.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

896 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

16 Experts available now in Live!

Get 1:1 Help Now