Mondays Mission: Macro to extract text from an email and paste it into an EXCEL Sheet

maxwello

New Member
Joined
Sep 20, 2013
Messages
40
Good Morning All,
I don’t know if this is possible but have hundreds of emails that I need to collect the data that is held in the body of the email. All the emails have the same text layout and the fields that I want to extract have the same headings. (See below example)

I would really appreciate any assistance or advice that you are able to provide.

Dear Sir,
Please find my account setup below.</SPAN>

User Name:Joe Blogs</SPAN>
User Firm:Blogs Inc</SPAN>
Email address: Joe.blogs@blogsinc.co.uk</SPAN>
Country:ENGLAND</SPAN>
UUID:1111111</SPAN>
User #:123456</SPAN>
Cust #:123456</SPAN>
Firm #:123456</SPAN>
Serial #:123456</SPAN>
Broker:ABAX</SPAN>
Application:Windows</SPAN>
 
This works perfectly after a few tweeks and it now produces a great powerpoint presentation. I am now trying to pick up infromation from a number of other emial folders but this time I only need the subject line, the date it was recieved, the to field and the catetgory that has been assigned to it.

I have tried amneding the previous scripts and set the Headers and UserPropertiesArray(1) with things like "To:" "msg.to" and the best result came from setting the header as "[msg.subject]" but this then returnd the same results for "to:".

Code:
Debug.Print oMailItem.subject 'Subject
Debug.Print oMailItem.To 'To
Debug.Print oMailItem.Categories 'Category
Debug.Print oMailItem.LastModificationTime 'Received

I am sorry to ask you again but can you help again with extracting that info as well as helping to work out how to make it search all sub folders under a folder.

Example structure:
Inbox
bloomberg
tradeweb
markit

Paste the code that you have an we'll have to update it slightly so that it takes a MAPI folder as a parameter.
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,216,622
Messages
6,131,777
Members
449,671
Latest member
OALes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top