【问题标题】:Different behaviour of vsto Outlook add-in in Outlook 2016 and Office 365Outlook 2016 和 Office 365 中 vsto Outlook 加载项的不同行为
【发布时间】:2021-12-12 02:30:08
【问题描述】:

我创建了一个 vsto Outlook 加载项,它在我的 Outlook 2016 应用程序中运行良好,但它的某些功能在 Office 365 Outlook 中不起作用。例如,当触发邮件发送事件时,在 Outlook 2016 中,mail.Sender 在发送该邮件之前为空,但在 Office 365 中,在发送邮件之前分配值。同样,mail.SentOnBehalfName 在 Outlook 2016 中为空,但在 Office 365 中包含发件人的Display Name

是否有网页形式的信息或可用的信息突出显示新版本的 Outlook 中对 VSTO 加载项所做的更改(我搜索但找不到)。还是由开发者在各个版本上测试插件,调试以了解差异,然后为每个 Outlook 版本找到解决方案?

【问题讨论】:

    标签: outlook vsto outlook-addin


    【解决方案1】:

    在实际发送邮件并将其移至“已发送邮件”文件夹之前,不保证会填充与发件人相关的属性。这不是特定于版本的。

    如果发件人为空,您可以假设将使用默认用户帐户 (Application.Session.CurrentUser)。

    【讨论】:

    • 我必须检查一个特定的邮箱。如果 Sender 是 xyz@abc.com 则只执行任务。现在要检索xyz@abc.com,我必须在 Outlook 2016 和 Office 365 中采用不同的方式。在 Outlook 2016 中,由于MailItem.Sender 为空,我必须使用`Outlook.Recipient recip = Globals.ThisAddIn.Application.GetNamespace( "MAPI").CreateRecipient(mail.SenderEmailAddress);` 然后使用 recip.AddressEntry.GetExchangeUser().PrimarySmtpAddress 。如果 Office 365 中安装了相同的加载项,mail.Sender 不为空。
    • SenderEmailAddress 也不保证被填充。
    猜你喜欢
    • 2016-10-27
    • 2017-07-17
    • 2020-08-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多