This documentation is archived and is not being maintained.
How to: Enumerate Folders on All Stores
|Outlook Developer Reference|
This topic shows a code sample that enumerates all folders on all stores for a session.
- The code sample begins by getting all the stores for the current session using the NameSpace.Stores property of the current session,
- For each store of this session, it uses Store.GetRootFolder to obtain the folder at the root of the store.
- For the root folder of each store, it iteratively calls the
EnumerateFoldersprocedure until it has visited and displayed the name of each folder in that tree.
To run this code sample, place the code in the built-in ThisOutlookSession module.