Outlook Export Script/ Macro
Before using the macro below please accept that you do so at your own risk.
Also please read the note at the top of the Macro about using it with Outlook 2007/ 2010 (see below and the top of the Macro).
If there are any bugs with this macro, or if you have any other feedback, please contact me using the comment form (below); if you do not want your comment published please say (also remember that if I have previously approved a comment by you next one will automatically be approved).
Also if you have any suggested features I am happy to consider them, but, I have had some nasty messages from people who want me to add specific features and want them added right away. Please before contacting me remember I am providing my work free of charge and I am a busy professional engineer and a father.
Also please accept those reasons as an excuse (and an apology) for the infrequent updates to this page.
With regard to paid work please contact my employer directly (more information can be found on my LinkedIn profile, icon above).
Outlook Export Script
Changes since last version
- File names are now shorter with a shorter date format – this is to reduce the instances of file permission errors when saving on NTFS based file systems (the error still occurs occasionally, usually when saving RSS feeds – it’s due to naming limitations with the NTFS file system that I have no control over)
- RSS/ News feed items are now exported correctly (no longer saved as “UNKNOWN CLASS 45″)
This is one of the most popular items on my site. Version 2.3 (December 2011) of my Outlook archive visual basic macro can be downloaded from the link above as a text file, to use open the visual basic editor in Outlook and paste in the code.
There are some instructions at the top of the script and you will have to follow them to set up the directory you wish to export to and if you wish to have the macro ask for a folder to export, or ask for the top level folder.
This version has been updated to work with Outlook 2007 and 2010 (please read the instructions on adding runtime libraries at the top of the Macro).
Once done run the new macro that has appeared in your list of available macro’s. Please note I do not know how this macro will react to other macro’s, and as always please test first on data you have backed up.
This free Macro does the following:
- Automatically Exports all standard Outlook objects (email, contact, calendar entry, read receipt etc) to a user configurable location , proprietary objects (e.g. a special company forms) are not supported, but may be exported anyway in a text only format.
- Retains folder structure.
- Saves Emails as HTML with an index number
- Supports backup of RSS feeds (this can be very slow, depending on how many subscriptions etc you have)
- Extracts attachments, saves with same index number as the email and adds notification and link to the original email
- Saves Calendar entries as both text and .ICS
- Saves Contacts as both text and .VCF
- Saves all other objects as text only, with index number
- Extracts any attachments from non-email objects and saves each attachment with the same index number as the object. A notification is added to the object.
This macro will not work if you have a folder in Outlook called ‘Attachments’, which is the name of the default folder that attachments are saved in (as a sub-folder of the one which the email etc is saved in), just give any folder with that name a temporary name like ‘Attachments1′ or the script will do odd things.
The Macro gives no error messages, no status update, and it will reduce Outlook’s performance to almost zero whilst it runs; so depending on how full your Outlook folders are you may be waiting a long time. You can either go to lunch, or for a little entertainment go to the folder you entered as ‘Path’, you should see a slowly growing folder list, and within each folder a growing number of HTML and text files. If you don’t see this then something went wrong (e.g. folder path incorrect), check that you entered your user options correctly.
You may also find problems with the file names and permissions of the exported files. Errors can include missing ends of file names and access denied messages, this is due to the limitations of NTFS filesystems and not a fault with the macro. For those of you using Linux I would consider using an Ext3 partition mounted under Windows with the Ext2Ifs driver to export to, particularly if you have a complex series of nested folders.
As with my earlier Outlook macro (no longer available) the reasoning behind writing this is to support the archiving of Outlook contents into something that can be viewed on any platform (primarily Linux) and indexed by free off the shelf indexing software (such as the now defunct Google Desktop, Beagle or Copernic Desktop Search).
If you are using Windows search this macro is a useful way of extracting old emails in a format that can be indexed by Windows without you having to keep giant PST files going back a decade or more associated with Outlook.
Bugs in Outlook 2007 and 2010
In both Outlook 2007 and 2010 the macro can hang and Outlook can be come totally unresponsive; this can happen at any time and is caused when the macro struggles to communicate with the exchange/ imap etc server (I have not noticed this when using POP), it can also happen when backing up from PST files (associated with an exchange account) as some information is still downloaded from the server.
The only advice I can give is to make sure you have a good link to your server (e.g. try this at work after everyone has gone home), or try using the macro with Outlook working offline.
Please note this error is intermittent and usually fixes itself within a minute or so.