Solved

Export Outlook email content to Access database using script

Posted on 2011-02-10
16
632 Views
Last Modified: 2012-08-14
Experts,
I get some gaming statistics via email after each game/session and in Outlook I’ve got a rule set up that places the email in it’s own folder. The email looks exactly the same every time in the sense of structure. What I would like to do is store the stats in an Access database.
To check the structure I selected the text and did a simple copy paste into excel and it retained a nice tabular format. Unfortunately if you were to just select all and pasted it into excel it didn’t work so hot since the email has embedded pics it uses as a background.
I would like to see if I can run a script that will extract the contents and place it into Access for me like it did when I pasted it into Excel. I for now I am not looking for it to be perfect I just would like to see it in Access.  Currently I am running Office 2010.
Thank you,
0
Comment
Question by:spaced45
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 6
16 Comments
 
LVL 20

Expert Comment

by:edster9999
ID: 34866514
You could write a VBA script that would read the mails and export.

http://www.google.com/search?q=outlook+script+to+process+data+in+email
0
 
LVL 1

Author Comment

by:spaced45
ID: 34866958
No. Most of what I saw talked about how to extract info like subject and sender. I need something that will grab info out of the body.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 34870059
Hi, spaced45.

I might be able to help.  Can you share the body of one of the emails?
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 1

Author Comment

by:spaced45
ID: 34870838
I sure can. Let me prepare a screenshot for you.
0
 
LVL 1

Author Comment

by:spaced45
ID: 34870875
0
 
LVL 1

Author Comment

by:spaced45
ID: 34870922
I dont know if this matters but if I were wanting to copy and past the text from the email into something else, I would have to be careful in positioning my cursor in front of the words "We hope you...." and ending after the number "3" at the bottom right corner. Starting anywhere else would select the image in the background. I can certainly tell that the text is in a tabular format because when I am making a selection I can see that its selecting in order.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 34871269
Could you export one of these messages to a .msg file and upload it to this question so I can use it to test the process?  
0
 
LVL 1

Author Comment

by:spaced45
ID: 34871600
I think I can do that.
EA-SPORTS--FIFA-11-Ranked-Head-t.msg
0
 
LVL 76

Expert Comment

by:David Lee
ID: 34872719
Ok, I have the extraction part done.  I need the details of the table(s) and fields the data goes into in order to do the code for inserting the data into the database.
0
 
LVL 1

Author Comment

by:spaced45
ID: 34873843
Wow! I appreciate this. I am going to upload an excel sheet with the numbers in the example I uploaded. Its going to be pretty simple table. Should take me about 5min. Thanks again.
0
 
LVL 1

Author Comment

by:spaced45
ID: 34874264
0
 
LVL 76

Expert Comment

by:David Lee
ID: 34938708
"What I would like to do is store the stats in an Access database. "

Ummm, I thought you wanted the data in Access.  I can put it into a spreadsheet, but that's going to be a lot more difficult, especially the way this spreadsheet is laid out.
0
 
LVL 1

Author Comment

by:spaced45
ID: 34966172
Confused? I was just showing using excel to show you what I was looking to do. Cant send and Access file over the web....
0
 
LVL 76

Expert Comment

by:David Lee
ID: 34974556
You can load an Access file here.  If you already have something, then I'd rather use it than create my own Access database and find that I've structured it differently from yours.
0
 
LVL 1

Author Comment

by:spaced45
ID: 35109322
I have not created it yet. Would it just be easier to export to excel. If so I could just import the excel sheet and it to a table using some code I have used before.
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 35113209
That wouldn't help.  If you want the macro to write the data to an Access database, then I need to know the name of the table and the name and type of the fields.  If the macro doesn't need to write to Access, then I can have it write to Excel.  You can certainly import the data from Excel to Access, but that would require an extra step.  
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
This article will help to fix the below errors for MS Exchange Server 2013 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

734 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