Reputation: 2749
I'm working on a Outlook Add-in developed in COM/ATL/C++ and I want to iterate over all subfolders of a particular Outlook folder, which is passed off as a MAPIFolder object.
According to Microsoft's docs, a MAPIFolder object includes a Folders property whjich consists of a Folders collection which represent all the available Outlook folders in a specific subset at one level of the folder tree. Yet, I haven't found any reference on how to iterate over these collections. Microsoft's docs are virtually nonexistent, and although there are examples covering similar features in C#, such as MS DevCenter How to: Get a Default Folder and Enumerate Its Subfolders, Microsoft does not offer any info on how to accomplish the same goal with C++.
Does anyone know how to iterate over all folders with calls to MAPIFolder and/or Folders objects?
Upvotes: 0
Views: 454
Reputation: 66215
Use a for
loop (from 1 to Count). Or call Folders.GetFirst
and use while
loop calling Folders.GetNext
on each iteration.
Upvotes: 0