如何迭代存储在MAPIFolder对象中的文件夹?

时间:2022-05-25 13:39:26

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.

我正在研究用COM / ATL / C ++开发的Outlook加载项,我想迭代特定Outlook文件夹的所有子文件夹,它们作为MAPIFolder对象传递。

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++.

根据Microsoft的文档,MAPIFolder对象包括一个Folders属性,该属性由Folders集合组成,该集合表示文件夹树的一个级别中特定子集中的所有可用Outlook文件夹。然而,我还没有找到关于如何迭代这些集合的任何参考。微软的文档实际上是不存在的,虽然有一些例子涵盖了C#中的类似功能,例如MS DevCenter如何:获取默认文件夹并枚举其子文件夹,但微软并未提供有关如何使用C ++实现相同目标的任何信息。

Does anyone know how to iterate over all folders with calls to MAPIFolder and/or Folders objects?

有没有人知道如何通过调用MAPIFolder和/或Folders对象来遍历所有文件夹?

1 个解决方案

#1


0  

Use a for loop (from 1 to Count). Or call Folders.GetFirst and use while loop calling Folders.GetNext on each iteration.

使用for循环(从1到Count)。或者调用Folders.GetFirst并使用while循环在每次迭代时调用Folders.GetNext。

#1


0  

Use a for loop (from 1 to Count). Or call Folders.GetFirst and use while loop calling Folders.GetNext on each iteration.

使用for循环(从1到Count)。或者调用Folders.GetFirst并使用while循环在每次迭代时调用Folders.GetNext。