Link to home
Start Free TrialLog in
Avatar of D B
D BFlag for United States of America

asked on

VBA Code to Read "Header" Info

I need one-time code that will read "From", "Subject" and "Date Received" from all messages in a specific folder in a local Outlook mailbox. The folder from which I wish to extract the data is "BAC\Summaries\Success" under the root, which is my email address (if that matters). This is a private OST file, not public folders.

As I indicated, this will be a one-time run, so I can create a temporary sub and run it through debug. The output desired would be a comma-delimited csv file.
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of D B

ASKER

Only change I had to make was in the SaveAs line. You'd entered strFil and it should have been strFilename. I also had to change the order of loading the cells, as the header didn't match up with the data. No big deal. Works like a champ.

Since I was going to open the file in Excel anyway, I changed the FileFormat from CVS to Excel.

Thank you very much!
You're welcome!