outlook folders

  • Thread starter Thread starter Sundeep
  • Start date Start date
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.
 
You'll need to handle the error. If the file has been deleted, then no store
is available and thus no StoreID.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top