I get hundreds of emails per day, all formatted exactly the same and I only need one small bit of info from the email. Here is what the body of the email looks like:
__________________________________________________________________________________________________________________________
Category: Inventory
Type: Information
Name: \\path
Date/Time: 10/05/2012 02:00:19 PM
Body:
A file has been processed.
Total Records Successfully Processed: 2011
Total Records with Error: 13
Details of Errors:
-------------------------
Error: Unable to validate product 00193957001
Error: Unable to validate product 39800064493
Error: Unable to validate product 31101741009
Error: Unable to validate product 02571571091
Error: Unable to validate product 04746000312
Error: Unable to validate product 01571810340
Error: Unable to validate product 19515088907
Error: Unable to validate product 67253046110
Error: Unable to validate product 50924027201
Error: Unable to validate product 74098527087
Error: Unable to validate product 19515088907
Error: Unable to validate product 19515088907
Error: Unable to validate product 38137005685
__________________________________________________________________________________________________________________________
The only part of the data I need is the 11 digit numbers after the phrase "Unable to validate product". I would like to select the emails in the inbox that I want to process, run a VBA macro, and have those 11 digit numbers copied to column A of a spreadsheet starting at A2. I would process through the numbers in the current spreadsheet, delete them, and resave a blank worksheet before processing the next batch of emails. I tried to take other VBA procedures I found online and adapt them to this but my VBA skills are weak at best. In a dream world, the marco would only process unread emails in the inbox. :D
Thanks in advance for any help
Bookmarks