Export Outlook Personal Folder to a .PST file

C

Chris Gregory

I'm a newcomer, so please forgive me if this is a boring question: does
anyone have the VBA code to export Outlook Personal to a .PST file, i.e.
automate the clikc sequence (in Outlook) File - Import and Export... - Export
to a file - Personal Folder File (.pst) - Personal Folders, include
subdirectories. I'm using Office 2000.
Thanks
 
K

Ken Slovak - [MVP - Outlook]

About all you can do for that with programming is to get the
CommandBarButton object that represents File, Import and Export to open the
dialog. Nothing in the dialog is exposed to the object model and there's
nothing in the object model to copy one PST to another.

You can create a brand new PST using NameSpace.AddStore() and then add
folders to the store (one for each one in the source PST). Then you would
get the source and target folders and use the CopyTo() method to copy from
source to target.

That's about it. I'm not sure it's worth all the programming time unless
this is something you do often and want to automate.
 
C

Chris Gregory

Ken, thanks for your reply and the ideas you suggest. Yes I want to program
this so I can copy all my emails in Outlook 2000 (.pst file) to another .pst
file for backup, while Outlook is still running (that's important). The next
step will be to schedule a job automatically to do this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top