Open store?

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
 
K

Ken Slovak - [MVP - Outlook]

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.
 
D

Dmitry Streblechenko \(MVP\)

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
 
S

Sue Mosher [MVP-Outlook]

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
 
D

Dmitry Streblechenko \(MVP\)

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
 
A

Anthony Yio

thanks, the function design is weird indeed.

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

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

Similar Threads


Top