通过 MAPI 接口从 MailItem 获取电子邮件文件夹
我正在创建一个程序来自动从传入的电子邮件附件生成报告,并且它几乎完成了一个区域的保存。传入的电子邮件会自动过滤到文件夹中,以区分它们来自哪个客户端和服务器。我不知道如何从电子邮件项目中获取文件夹的路径。
我使用 NewMailEx
事件调用下面的方法,并确认 this.AppNamespace
和 this.ReportFolder
已正确实例化。
void AppClass_NewMailEx(string EntryIDCollection)
{
Outlook.MailItem Item = (Outlook.MailItem)this.AppNamespace.GetItemFromID(EntryIDCollection, this.ReportFolder.StoreID);
string FolderName = ""; //How do I get this?
}
MailItem
上的 MSDN 为
I'm creating a program to automatically generate reports from incoming email attachments and it is almost complete save for one area. The incoming emails are automatically filtered into folders which differentiate which client and server they originate from. I can't figure out how to get the path of the folder from the email Item.
I'm using the NewMailEx
event to call the method below and this.AppNamespace
and this.ReportFolder
are confirmed to be instantiated properly.
void AppClass_NewMailEx(string EntryIDCollection)
{
Outlook.MailItem Item = (Outlook.MailItem)this.AppNamespace.GetItemFromID(EntryIDCollection, this.ReportFolder.StoreID);
string FolderName = ""; //How do I get this?
}
The MSDN on MailItem
is here. Am I missing something or approaching this the incorrect way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您可以检查一个 Parent - 它应该返回一个 MAPIFolder,您可以检查其名称。
I think there's a Parent that you can check - it should return a MAPIFolder that you can check the Name of.