Re: Parsing Mail Messages
- From: grep <grep@xxxxxxxx>
- Date: Sun, 01 Jan 2006 14:42:24 -0500
I'm still having trouble with this. Perhaps it would be helpful to break this into discreet steps:
Step 1: Grab the appropriate message
The intent here is to call this from an Outlook rule. The rule will determine which messages are the right messages, and pass along the message object to the script. If my reading is correct, this is actually fairly easy and straightforward. The MailItem is passed as a parameter to the procedure, I think, so that's already taken care of.
Step 2: Parse the message body for specific information
This part, I think I might actually have a handle on. The idea here is to take the body of the message, search each line for specific keywords, and then put their subsequent values into array. The only part of this I'm not sure how to handle is how to actually get the body text of the message so that I can parse it in this line-by-line fashion.
Step 3: Dump the data
The data stored in the aforementioned array will need to be saved out. If necessary, this can be to a delimited text file, but preferably it would be to a database. For all intents and purposes, the database will be Access. I may actually wind up using MySQL for the backend, I'm not sure yet, but the front end will likely be Access.
Step 4: Save out the attachment
Every message in this group will have an attachment. This attachment needs to be saved to a database as well. If necessary, it could be saved out as a file, but then I'll have to import it to the database anyway.
Step 5: Delete the message When all this is done, the message is no longer necessary.
That's it. I think I understand how to do the bulk of the work, but the devil's in the details. I don't really understand how to get the information that I need yet. Any help would be appreciated.
grep
grep wrote:
I get emails from one of my vendors, to help me keep track of my clients' accounts with them. These messages contain about 6-7 pieces of information that I would like to capture, before I get rid of the email. Specifically, I would like to write a script, called from a rule, that would parse a message for specific text, grab the data that follows that text, and pop it into an Access database, or at least a CSV file.
Further, if possible, I'd like it to grab the attachment (there's always a zip-file attachment), and place that in the database as well. These are very small zip files, and I don't think they'll pose a problem.
How can I do this? Can anyone point me in the right direction? (I'm new to this stuff.)
grep
.
- Follow-Ups:
- Re: Parsing Mail Messages
- From: Ken Slovak - [MVP - Outlook]
- Re: Parsing Mail Messages
- Next by Date: Re: Parsing Mail Messages
- Next by thread: Re: Parsing Mail Messages
- Index(es):
Relevant Pages
|