从 Outlook 获取收件箱
我在 Outlook 2010 中配置了两个 Exchange 帐户,但是我无法找到如何访问第二个帐户的收件箱。 Session.GetDefaultFolder()
始终返回第一个。
即使枚举 Session.Accounts,找到正确的帐户并调用 Session.Account(found one).Store.GetDefaultFolder()
返回错误的收件箱(来自默认交换帐户,而不是次要)。
I configured two Exchange accounts in Outlook 2010, however I cant find out how to get to Inbox of the second account. Session.GetDefaultFolder()
always return the first one.
Even enumerating Session.Accounts, finding the right account and calling Session.Account(found one).Store.GetDefaultFolder()
returns wrong Inbox (from the default exchange account, not the secondary).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
也许您早已放弃了这个问题,但这里...
我以前也遇到过同样的问题,我通过添加 Outlook 帐户管理 API 解决了它。不幸的是,这是一个面向 C++ 的 API。 (我的插件已经用 C++ 开发)
此外,VBA 和 .NET 插件使用的 OOM(Outlook 对象模型)对多个帐户的支持很差(如果有的话)。通过添加交换帐户,您实际上已将多个帐户添加到您的个人资料中。
因此,您可能需要降低一个级别,使用 MAPI 和 C++,然后挂钩 Outlook 帐户管理 API。这是一项繁重的工作,但这正是我所做的,而且效果非常好。
另外,这里有一个例子:
http://www.codeproject.com/KB/IP/IOlkAccountManager.aspx
Maybe you have long given up on this question, but here goes...
I've had this same problem before and I solved it by adding the Outlook Account Management API. Unfortunately for you, this a c++ oriented API. (My addin was already developed in c++)
Furthermore, the OOM (Outlook Object Model) which VBA and the .NET addins use has poor (if any) support for multiple accounts. By adding to exchange accounts, you have essentially added multiple accounts to your profile.
So, You might have to go down a level, using MAPI with c++ and then hook in the Outlook Account Management API. It's a lot of work, but that's exactely what I did and it worked like a charm.
Also, here is an example:
http://www.codeproject.com/KB/IP/IOlkAccountManager.aspx
我想这是一个旧的,但有一天可能有人需要它。
以下是迭代 Outlook 中所有“已发送邮件”文件夹的代码。 (我认为这仅适用于 Outlook 2010 及更高版本)。
I guess this is an old one, but somebody might need it one day.
Here is code to iterate all "Sent Mail" folders in Outlook. (I think this will only work for Outlook 2010 and newer).
这是否显示了所有可用的收件箱?
如果是这样,那么
ns.Folders(i).Folders("Inbox")
将为您提供每个邮箱的收件箱。Does this show you all the available Inboxes?
If so then
ns.Folders(i).Folders("Inbox")
will get you the Inbox for each mailbox.使用
Store.GetDefaultFolder
而不是Namespace.GetDefaultFolder
。请注意,
Store.GetDefaultFolder
是在 Outlook 2010 中添加的。在早期版本的 Outlook 中,使用扩展 MAPI(C++ 或 Delphi)或 救赎(我是其作者)-RDOStore.GetDefaultFolder
。Use
Store.GetDefaultFolder
instead ofNamespace.GetDefaultFolder
.Note that
Store.GetDefaultFolder
was added in Outlook 2010. In the earlier versions of Outlook use Extended MAPI (C++ or Delphi) or Redemption (I am its author) -RDOStore.GetDefaultFolder
.转到 Mapix 库
Mapix 库链接如下所示
C++/MFC 的 Mapix 库
注意:< /strong> 该库适用于 MS Outlook 中的收件箱电子邮件
To Go to Mapix library
Mapix library link as given below
Mapix library for C++/MFC
Note: This Library valid for Inbox emails in MS Outlook