VBA is fine for that. The main limitation for VBA code is it's not designed
for deployment to other users, and it can't handle Outlook 2007 or 2010
Ribbon or FormRegion callbacks. Other than that it shouldn't be any problem.
The link I provided has code you can modify to strip the attachments on the
selected items and save them to temp folders. From there you should be able
to do your parsing easily if you are familiar with VBA. I used
FileSystemObject for the file processing which should be OK, and if desired
you can just remove the lines that delete the saved attachments so they
remain on the original items.
For not using only selected items but for iterating the contents of a folder
looking for items with a "details.txt" attachment you can use a procedure
that gets passed the folder and does something like this:
Dim colItems As Outlook.Items
Dim obj As Object
Dim oMail As Outlook.MailItem
Dim colAttach As Outlook.Attachments
Dim oAttach As Outlook.Attachment
Set colItems = folder.Items
For Each obj In colItems
If obj.Class = olMail then
Set oMail = obj
Set colAttach = oMail.Attachments
If colAttach.Count > 0 Then
For Each oAttach In colAttach
If oAttach.DisplayName = "details.txt" Then
' process this item
And so on.
Searching at www.outlookcode.com
for specific things such as "iterating
Outlook folders" should get you samples of the other pieces you need.
"Diane" <Diane> wrote in message
> I'm very familiar with VBA, this is the route that I intend to take.
> I've done many VBA projects in Word and some in Excel, but none with
> I have subfolders that mail filters into within my inbox, from these
> subfolders, I would like to create a program that can
> 1) read the header, (or the attached "details.txt" file), find the error
> 2) for any invalid emails, mailbox fulls, etc....., run an sql delete
> statement that will remove invalid emails from a database.
> I'm good with doing step 2, it's just getting me started on step #1. I
> noticed for any "Mail Delivery" failures, that is where I find the
> "details.txt" file. This file has the status code and the Final-Recipient
> info that I would like to work with in step 1 of my VBA code.
> Anyway, I believe VBA is the way that I want to go with this, if you have
> other advice for this situation, I'm interested.