Outlook 2007 export script?

Recommended Posts

DietCoke 0

DietCoke 0

I need to export all mailbox items *other than email* from an Exchange mailbox into single purpose pst files (ex. calender.pst, contacts.pst, etc). In looking through the Outlook.udf threads I'm not seeing anything specific to that. Am I missing something or is this functionality not there?

Share this post

Link to post

Share on other sites

orbs 155

orbs 155

if you mean to export folders that contain items other than email messages, this is one thing. if you have folders that incorporate several items types, that's another thing. both tasks can be accomplished by water's OutlookEx UDF. which one is your task?

Share this post

Link to post

Share on other sites

DietCoke 0

DietCoke 0

if you mean to export folders that contain items other than email messages, this is one thing. if you have folders that incorporate several items types, that's another thing. both tasks can be accomplished by water's OutlookEx UDF. which one is your task?

Thanks to both you and Water. I'm actually looking to back up everything *but* mail if possible. Critical items are contacts, notes & calender. The goal is to make a local PST and backup the aforementioned items from the Exchange server to it.

I understand the differentiation between ItemExport and ItemCopy, but is there a constant for an Exchange mailbox? Somewhere where I can just specify the folder I (example, this is definitely non-working code):

Share this post

Link to post

Share on other sites

orbs 155

orbs 155

to my understanding, _OL_ItemCopy() can handle only a single item (by the EntryID) and is not recursive. unless i'm 180 degrees off course, that means you need to first enumerate your folders with _OL_FolderTree(), then loop the folders, and for every folder that is not a mail store, loop all items and then for each item use _OL_ItemCopy().

later you can either repeat that on regular intervals (e.g. daily), or hook on an event to let you know when an item is added or modified.

unless water have some better method, i'll post a piece of code to demonstrate how i do it.

b.t.w to my experience, when it comes to contents, there is nothing specific to Exchange mailbox compared to local PST file.

Edited July 31, 2013 by orbs

Share this post

Link to post

Share on other sites

water 1,778

water 1,778

A bit easier would be to use _OL_ItemFind to search for contacts and set parameter $iFlags = 1 to search subfolders too (recursive search). Then use _OL_ItemCopy on each returned item to copy it to the PST. Repeat this for all other item classes.