@fsommi
Hello again fsommi
You can attach your Outlook inbox to Access as you have discovered. (
You can attach any folder from Outlook in this manner actually) but the presentation as you have seen is in a fixed column layout and does not contain the attachments nor indeed any reference to them other than a yes/No boolen flag column.
There is no magical easy command in Access that enables you to just open Outlook at a particular email message and show you in the outlook window.
You mentioned there exists no unique key for an email message?, actually there is, but it is not exposed within Access... it is in Outlook. The field is called
EntryID.
EntryID is the item of data assigned to the email message you 'could' use this a point of reference to work with in Access.....a unique primary key if you will.
Attachment filenames are also in Outlook and of course we know we can attach one or more files to a conventional email message when it is sent when we use Outlook.
So how do we deal with this data in Access? we do that by automation by importing
INTO Access so that we can manipulate it in some form or another using recordsets. In doing so we grab whatever we can from Outlook to enable us to see the mail message in Access and manipulate potentially
many filename attachments so that we can
view them or
open them in a native program (
ie .DOC, .PDF, .JPG) by simply clicking on a button or double clicking a textbox within Access.
You will appreciate that if we are working IN Access we can never see anything unless we import it, in one form or another, whether that is table stored or held in memory temporarily and displayed on a form.
I have 'knocked up' a database today that I have attached for you.
(written in Access 2000) This demonstrates the interaction between Access and your inbox. Take a look, rip it apart and see what you can do with it. The main form to open is a form called
frmEmail.
This form calls code from a code module and relies on a value in a lookup table to set a folder path for extracting your inbox attachments into. If the folder does not exist then it will create it for you.
The code loops through your inbox importing your email messages into a table called tblEmail. It examines attachments and if they exist pumps each filename into a table called tblFileAttachments. Each row in this table is one file and is referenced by the EntryID I spoke of earlier. The code goes on to create the file in the extraction folder.
We have then two tables one for mail messages and one for attachments the classic one to many relationship essentially. The form displays buttons enabling you to go straight to the file in explorer without having to find it per se. Alternatively you can view the attachment in a native program
FROM Access (
ie a program associated with the file extension on your PC)
This may indeed not be what serves your needs best, but at least is a start for any research you might have
Happy Coding :)