I plan to do a project that involves manipulating emails. Although I started to do this in Outlook VBA, some plans I have to e.g. report intermediate results made me decide to switch to Excel (I’m also more ‘at home’ in Excel VBA to be honest).
The actions I’m planning will occur (only) on separate PST-files [Outlook Personal Folders] (I know there are also OST files, don’t know the difference but for now, again, my focus is on PST files as I have these).
Now there seem to be two ways to get to the emails in the PST file:
(A) Indirectly. Load the PST in Outlook and then program in Excel to open an Outlook.app and do the processing from there (what I find everywhere when I search the Internet).
( Forget about Outlook and work with the PST file directly (of course then the PST shouldn’t be open in Outlook at the same time as it will then be locked).
Option “B” seems most elegant. Is that possible? In other words, can I select a PST-file in EXCEL VBA en then open it (if required, providing the password) and then read, process and write it (using normal “Outlook” calls)? In the first ‘sweep’ I just want to go over the folder structure and acquire information on all emails (type, size, #attachments, size of attachments, names of attachments, dates subject etc.). After I’m done, could I even ‘compress’ it the way its done via Outlook?
Again, I can get to the emails using option “A” pretty easily but I’d like B much better as it is ‘cleaner’ in its approach.
Ideas? Code snippets?
Thanks!
Erik Jan