Testing NameSpace for a connected .pst

  • Thread starter Thread starter Steve Roberts
  • Start date Start date
S

Steve Roberts

Is there a simple test to see if a connection to a .pst exists in the
current namespace?

I have a program that walks all the folders and creates a new .pst file
using the name of the current folder. After creating the .pst file, the
program moves email into it. The problem arises intermittently when it
walks through 20+ folders. It seems to not refresh the namespace so it
doesn't know that the recently .pst file is connected even though I can see
it in the folder list.

Kinda seems like a timing issue. What I am hoping for is a way to see if the
recently created folder exists or not before moving on to the next step. Or
maybe a way to refresh the namespace after each folder is added.

I am using the following line to add the .pst.

MyNameSpace.AddStore "c:\" & olNewFolder.Name & ".pst"

Thanks in advance for any suggestions you may have.

Steve
 
Loop through all folders in Namespace.Folders collection saving all
MAPIFolder.EntryID, then call Namespace.AddStore . Loop through
Namespace.Folders again. The folder not in the original list in the new PST
root folder.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top