[AccessD] Automating Outlook from Access

John Colby jwcolby at gmail.com
Sat Aug 21 07:20:51 CDT 2021


I am working on an app to process orders for a program.  A web site takes
an order, accepts payment, then sends an email containing the order info.
I need to receive the email, put email info into an email table, parse the
order info out of the email body, put the order into an Order table, pull
client info out of the order, place the client info into a client table,
then go back and tie the email and order to the client via a client id.

All of the outlook automation I learned from my best friend Google.  I'll
write up how I am doing this stuff for anyone interested. I am not an
expert and so any suggestions for how to do it better is good.  I will
write a handful of emails to detail the parts and pieces.  This is actual
code I am using

In order to automate Outlook I need to sink Outlook events as email comes
in which requires a class.  I create a plain old module to hold pointers to
the Outlook class:

Option Compare Database
Option Explicit

Private mclsOutlook As clsOfficeOutlook

Function cOl() As clsOfficeOutlook
    If mclsOutlook Is Nothing Then
        Set mclsOutlook = New clsOfficeOutlook
    End If
    Set cOl = mclsOutlook
End Function

Function cOlTerm()
    Set mclsOutlook = Nothing
End Function

-- 
John W. Colby
Colby Consulting


More information about the AccessD mailing list