To get the store IDs, just iterate the Namespace.Folders collection:
Set objOL = CreateObject("Outlook.Application")
Set objNS = objOL.GetNamespace("MAPI")
For Each objFolder in objNS.Folders
strStoreID = objFolder.StoreID
MsgBox strStoreID
Next
Hi
If there are 5 pst files which can open in outlook. then registry
contains information for all these 5 pst files.The following statement will
execute 5 times for each pst file's top level folder.
For Each objFolder in objNS.Folders
If any pst file is accidently delete in system, then following statement
gives error.
strStoreID = objFolder.StoreID
because its entry exist in registry but file is deleted.
So how to solve this problem.