Export pst file using VBA

  • Thread starter Thread starter Shidan
  • Start date Start date
S

Shidan

I'm looking for code to:

Export to a PST file
Personal Folders Including Subfolders
Save to my path

I've been writing Word and Excel macros for a couple
years now and I would like to create a macro in Outlook
to export my pst to a network folder and I'm having
trouble getting started. I've searched help and the web
and haven't found the VBA equivalent of Import/Export
from the file menu. The recorder is a handy learning
tool; I wish Outlook 2003 had it!
 
You can add any existing PST file or create a new one using the
NameSpace.AddStore method and later detach it using the .RemoveStore method.
You would navigate the folder tree and create a new folder in the added
store for each one in the old store (if it didn't exist in the new one
already). You would get the Items collection of each folder and use the Copy
method to copy each item to the added PST's Items collection for that
folder.

See the Object Browser's Help for AddStore and RemoveStore and go to
http://www.outlookcode.com/d/vb.htm for information to get started using
Outlook VBA.
 
Back
Top