首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用addin-express从约会检查器窗口获得委托电子邮件帐户的信息- outlook 2013

使用addin-express从约会检查器窗口获得委托电子邮件帐户的信息- outlook 2013
EN

Stack Overflow用户
提问于 2015-06-18 09:27:20
回答 1查看 447关注 0票数 0

我正在开发一个Outlook插件使用外接程序.有两个邮件帐户(A)允许通过委托访问帐户(B)。我正在为帐户(B)开发插件。

这里是我想要实现的.

我使用帐户(B)的凭据(以用户身份,而不是通过C#代码)在登录到outlook后打开(A)的日历帐户。然后双击日历的某个日期,这将为我打开一个新的检查窗口。在检验员的丝带里,有一个按钮来自我的插头。用户单击按钮后,我需要显示电子邮件所有者的电子邮件(帐户(A))的电子邮件和名称在正文的检查员。

这里是按钮的代码

代码语言:javascript
复制
    private void adxRibBtnDelegateTest_OnClick(object sender, IRibbonControl control, bool pressed)
    {
        Outlook.Inspector currentInspector = null;
        Outlook.AppointmentItem myAppointment = null;
        Outlook.MailItem myMailItem = null;

        string ownerEmail = string.Empty;
        string ownerName = string.Empty;


        try
        {
            currentInspector = Globals.ObjOutlook.ActiveInspector();
            myAppointment = currentInspector.CurrentItem as Outlook.AppointmentItem;
            myMailItem = currentInspector.CurrentItem as Outlook.MailItem;

            Outlook.AppointmentItem appt = currentInspector.CurrentItem as Outlook.AppointmentItem ;
            Outlook.MAPIFolder parent = appt.Parent as Outlook.MAPIFolder;

            // ToDo:
            // Here I need to develop the functionality for getting the delegated account owner's email and name

            string body = "\n\nOwner's Email\t: " + ownerEmail
                + "\nOwner's Name\t: " + ownerName;

            if (myAppointment != null)
            {
                myAppointment.Body = body;
            }
            else if (myMailItem != null)
            {
                myMailItem.Body = body;
            }

        }
        catch (Exception ex)
        {
            Debug.DebugMessage(2, "Error in AddNewNationalCall() : " + ex.Message);
        }
        finally
        {
            if (myAppointment != null) Marshal.ReleaseComObject(myAppointment);
            if (myMailItem != null) Marshal.ReleaseComObject(myMailItem);
            if (currentInspector != null) Marshal.ReleaseComObject(currentInspector);
            GC.Collect();
        }
    }

你能给我个建议吗?谢谢。

EN

回答 1

Stack Overflow用户

发布于 2015-06-18 13:34:10

Outlook对象模型没有为此提供任何内容。您可以尝试获取Store对象并检查它的名称(请参阅文件夹类的商店属性)。通常,显示名称包含一个电子邮件地址(请参阅DisplayName),但它不是万能的。

我建议使用任何低级别的属性查看器工具,如MFCMAPI或OutlookSpy。它们允许观察您可以使用PropertyAccessor类访问的低级属性值(以及OOM)。Outlook只是扩展的MAPI的一个大型包装器。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30911510

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档