
VBA to Import and Export PST files
I am not sure what you mean - do you mean pass file names to AddStore()? If
you pass the path to an existing PST file, it will be opened, if it does not
exist yet, it will be created.
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Quote:
> This turned out to be great information. Now I want to tie it all
> together. I've used Restrict to make a set of messages that were
> Received on or after a given date, and I used AddStore to create a new
> PST file. How do I 'pass' the set of files to the new PST file?
Quote:
> > See below
> > Dmitry Streblechenko (MVP)
> > http://www.dimastr.com/
> > OutlookSpy - Outlook, CDO
> > and MAPI Developer Tool
> > > - Create a PST file given the path.
> > Call Namespace.AddStore() passing a fully qualified path to the new PST
> > file.
> > > - Allow the user to choose the Outlook folder from which
> > > to export (Personal, Public, etc), including subfolders.
> > Call Namespace.PickFolder to let user select a folder. Selected
MAPIFolder
> > object will be returned.
> > > - Choose not to export duplicate files.
> > I am not sure what you mean,
> > > - Export only files Received on or after a given date.
> > Use MAPIFolder.Items.Restrict() passing the appropriate restriction to
get
> > back a restricted collection of items from the particular folder.