Getting MAPI entryID’s From Outlook Folders

Getting MAPI entryID’s From Outlook Folders

This tip is useful if you do Outlook automation with user created Outlook folders. These folders cannot be accessed by the GetDefaultFolder method usually employed in automation techniques. This snippet displays the folder name and MAPI entryID number for the folder. The GetFolderFromID can then be used to access and manipulate the user created folders and the items contained within. You must also make sure that you are referencing the appropriate Outlook library by going to the project and then to the references menu. This example only does one nested level, but the pattern is fairly obvious and should be easy to follow if there are more than two levels of outlook folders.

 Dim oAPP As New Outlook.Application, oNAMESPACE As Outlook.NameSpaceDim i , j As StringDim atopFolders , abottomFolders As Outlook.FoldersDim topFolder , bottomFolder As Outlook.MapiFolderSet oAPP = CreateObject(


Share the Post: