帐户集合不包含我的所有帐户 - VSTO(Outlook 2016) - C# [英] Accounts collection doesn't contain all my accounts - VSTO (Outlook 2016) - C#

查看:98
本文介绍了帐户集合不包含我的所有帐户 - VSTO(Outlook 2016) - C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为Outlook编写了一个VSTO插件,它为插件选项卡添加了几个按钮。除了一点点烦恼之外,一切都按照我想要的方式运作。我正在尝试找到当前文件夹的帐户,以便我可以从该帐户发送。

I've written a VSTO addin for Outlook which adds a few buttons to the addins tab. Everything is working the way I would like except for one little annoyance. I'm trying to find the Account for the current folder, so that I can send from that account.

我在网上看到很多示例如何获取文件夹,商店和帐户集合。但是,当返回帐户时,它只包含一个(我的个人交换邮箱),但我有两个。

I've seen many examples online which show how to get the Folder, the Store and the Accounts collection. However, when Accounts is returned it only contains one (my personal exchange mailbox) but I have two.

以下代码导致MessageBox显示为"1"。

The following code results in a MessageBox showing '1'.

Accounts accounts = Globals.ThisAddIn.Application.ActiveExplorer().Session.Accounts;
MessageBox.Show(accounts.Count.ToString());

非常感谢帮助。

问候,

罗素

推荐答案

你好RusselKain81,

Hello RusselKain81,

我无法重现您的问题。这两个账户的类型是什么?它们都是交换邮箱吗?

I could not reproduce your issue. What's the type of these two accounts? Are they both exchange mailbox?

另一个帐户是POP帐户还是IMAP帐户?

Is the other account a POP account or IMAP account?

此外,您办公室的版本是什么?您是否尝试过更新到最新版本?

Besides, what's version of your office? Have your tried to update to latest version?

最好的问候,

Terry


这篇关于帐户集合不包含我的所有帐户 - VSTO(Outlook 2016) - C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆