I have ac# add-in in outlook and I am trying to get the current recipient email address. If only one window with a single mail is opened the code bellow works. If the multiple emails are opened, the code bellow returns the last opened email address. Selection.Count is 1, even if I open 3 emails. Can you please help me?
I have also tried iterate them, but in the Selection, it is retrieved only the last opened email address
foreach (MailItem email in new Microsoft.Office.Interop.Outlook.Application().ActiveExplorer().Selection)
{
yield return email;
}
不要使用Application.ActiveExplorer
,而是使用Application.ActiveWindow
并检查它是Explorer
(使用Explorer.Selection
集合)还是Inspector
(使用Inspector.CurrentItem
)。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.