473,394 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Opening Outlook original message from a linked Outlook mailbox

4
I successfully linked a mail Outlook folder into an Access database. Now I'm trying, if possible, to open the selected email messagge. I do not need to create a new message starting from access or to import messages information into a table, I just need to view the original message in its Outlook format.
I'm aware that there is'nt any unique record ID in Access table linked to Outlook linked folder so I'm wondering if there is any chance to write some VB instructions in order to get this working. I found something similar on the web but not exactly what I need. I tried something like Outlook.Application function but I'm quite lost. Any help GREATLY appreciated.
Thanks in advance and sorry for my english
Apr 29 '10 #1

✓ answered by Jim Doherty

@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 :)

7 4681
Jim Doherty
897 Expert 512MB
@fsommi
Your post is a little confusing! you have linked the folder as an attachment into Access yet you cannot read the messages? the table contains the body column and the relevant CC and BCC associated with email messages and the data. How come you cannot simply manipulate what you now see as an attached table in Access ie: create a form based on the attached table or query the table for whatever it is you need to do?


Welcome to Bytes :)
Apr 30 '10 #2
fsommi
4
Hi Jim,
Thanks so much for your reply and sorry for the confusion. I try to explain more clearly. I attached an Outlook mailbox (Inbox) as an attached table. The attached table contains all relevant massage fields (sender, subject, CC, body message, etc.) I also created a form based on the attached table and I can view and manipulate all. Anyway most emails contain an attachment which is not available in the attached table (only a yes/no flag is displayed to check whether a file is attached). If I want to open the attached file I first need to open the original email message (in its own Outlook window). Is it possible to do this starting from the Access form based on the attached table?
I would like to view email messages attachments directly from Access, whitout beeing forced to switch to Outlook main window instead.
Thanks in advance for your help
Apr 30 '10 #3
Jim Doherty
897 Expert 512MB
@fsommi
Ok I understand you better now I will have a look at this a little later today and come back.
Apr 30 '10 #4
Jim Doherty
897 Expert 512MB
@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 :)
Attached Files
File Type: zip emails.zip (35.8 KB, 335 views)
May 1 '10 #5
fsommi
4
Hello Jim,
Thank you very much for your help. It seems to be a great solution indeed and a really effective point of start. I'll test your code and come back later.
May 3 '10 #6
fsommi
4
Hi Jim,
I tested your code and it works fine! I will adjust it to make it suitable for my porpouse even if I would prefer not to fully import mailbox messages and attachments into Access tables (anyway I agree this is the best way to directly manage mailbox content from an Access database).
I need to import not just the default inbox but specific Outlook mailbox, so now I'm coding in order to make this working. I will post results as soon as ready.

Thanks so much again for your help
May 5 '10 #7
Jim Doherty
897 Expert 512MB
@fsommi
You,re welcome, glad it helps you a little :)
May 5 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Google Mike | last post by:
I've got RH9 Linux with default PHP. Is there a way to send email on Linux to an Exchange Server from PHP and/or other tools when there is *NOT* SMTP access? Has anyone figured out a way to...
6
by: enak | last post by:
I need some help. I have a group of attorneys that need to be able to see the schedule of court dates. These dates are scheduled by the legal assistants. This is what I need: when a legal...
2
by: Roger | last post by:
I am creating an application that will sit on a client pc and monitor the inbox. When an e-mail enters the inbox, then an even will be fired and I will then be able to process the mail. I have...
1
by: Roger | last post by:
I currently have an application that can monitor the Inbox of one mailbox running on a client using Outlook 2003. This is a standalone application that needs Outlook to be running in order to see...
4
by: Pieter | last post by:
Hi, On the pc of one of my clients (W2000, Office 2003) I'm getting sometimes an exception when moving (Move) a MailItem to an Outlook-Folder: The RPC server is not available. (Exception from...
3
by: tshad | last post by:
I have a program that is reading one of my mailboxes. It is polling the mailboxes ever 5 minutes to see if there is a message or not. Is this how Outlook does it (using Exchange as the...
1
by: =?Utf-8?B?cm9i?= | last post by:
C#.Net Outlook 2003 automation (programmatically) with Office.Interop.Outlook Problem: I have my outlook 2003 configured with multiple mailbox on my local machine. I want to specify the mailbox...
1
by: allbelonging | last post by:
C#.Net Outlook 2003 automation (programmatically) with Office.Interop.Outlook Problem: I have my outlook 2003 configured with multiple mailbox on my local machine. I want to specify the mailbox...
0
by: DianaC | last post by:
Hi. I have to generate and send emails from C#.net 2.0 and have to use outlook. I am using Redemption to bypass the outlook security checks, but have the same problem when using CDO. I create an...
4
by: infomage27 | last post by:
I have tried scripting this with rules and VBA, now trying with C# but still failing. (code is exploratory, so please excuse the terribleness) maybe someone here will show me the error of my...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.