Open store?

  • Thread starter Thread starter Anthony Yio
  • Start date Start date
A

Anthony Yio

Hello,

I have added a store (*.pst) file. How should I open the pst from the
code to be access?

thank you
 
If you used the AddStore method then the new store will be one of the top
level members of the NameSpace.Folders collection. You can get a count of
those folders before you add the store and then the newest one will have an
index 1 higher than the previous last folder.
 
Not necessarily - I had problems with this approach. A more robust solution
would be to enumerate all top level folders (Namespace.Folders) storing
their StoreID property, call AddStore, loop through Namespace.Folders
again - a folder with StoreID not in the original collection is the new PST
store.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
I've also had reports of the index being unreliable. Dmitry's approach is
solid.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Really makes you think how one minor OOM design flaw can become a
potentially big problem - things would've been much easier if AddStore
simply returned the new top level folder...

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
thanks, the function design is weird indeed.

thank you, you guys, Ken, Dmitry and Sue.
 
Back
Top