首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Outlook 2013在电子邮件回复和转发上添加-“弹出”窗口:界面类型是什么?

Outlook 2013在电子邮件回复和转发上添加-“弹出”窗口:界面类型是什么?
EN

Stack Overflow用户
提问于 2016-02-23 16:39:57
回答 2查看 86关注 0票数 0

我一直在为Outlook 2013开发一个插件,目前我发现在回复和转发电子邮件时很难找到Outlook 2013中出现的“弹出”窗口的接口类型。

例如:对于新建电子邮件,接口类型为Outlook.MailItem,对于会议请求,接口类型为Outlook.AppointmentItem。

我可以使用什么接口类型来识别在Outlook 2013中回复和转发时弹出的窗口?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-02-29 15:40:08

我的经理和我坐在一起,努力解决这个问题,谢天谢地找到了解决办法。您可以使用以下代码访问“弹出的”回复窗口和转发窗口

代码语言:javascript
复制
//First, declare the interface type of Explorer
public static Outlook.Explorer currentExplorer;

//Create a method to identify the Inline response as a MailItem
    private void ThisAddIn_InlineResponse(object Item)
    {
        if (Item != null)
        {
            Outlook.MailItem mailItem = Item as Outlook.MailItem;
        }
    }

//Direct to the ThisAddIn_Startup() method and add an event handler for the Inline Response Method

currentExplorer.InLineResponse += ThisAddIn_InLineResponse;

//Access the popped in reply and forward window where required
object item = null;
item = currentExplorer.ActiveInlineResponse;
票数 0
EN

Stack Overflow用户

发布于 2016-02-24 09:25:07

当您回复或转发邮件项时,新项目将是一个MailItem对象。您可以使用折叠代码来确定项目类型:

代码语言:javascript
复制
        Object selObject = this.Application.ActiveExplorer().Selection[1];
        if (selObject is Outlook.MailItem)
        {
            Outlook.MailItem mailItem =
                (selObject as Outlook.MailItem);
            itemMessage = "The item is an e-mail message." +
                " The subject is " + mailItem.Subject + ".";
            mailItem.Display(false);
        }
        else if (selObject is Outlook.ContactItem)
        {
            Outlook.ContactItem contactItem =
                (selObject as Outlook.ContactItem);
            itemMessage = "The item is a contact." +
                " The full name is " + contactItem.Subject + ".";
            contactItem.Display(false);
        }
        else if (selObject is Outlook.AppointmentItem)
        {
            Outlook.AppointmentItem apptItem =
                (selObject as Outlook.AppointmentItem);
            itemMessage = "The item is an appointment." +
                " The subject is " + apptItem.Subject + ".";
        }
        else if (selObject is Outlook.TaskItem)
        {
            Outlook.TaskItem taskItem =
                (selObject as Outlook.TaskItem);
            itemMessage = "The item is a task. The body is "
                + taskItem.Body + ".";
        }
        else if (selObject is Outlook.MeetingItem)
        {
            Outlook.MeetingItem meetingItem =
                (selObject as Outlook.MeetingItem);
            itemMessage = "The item is a meeting item. " +
                 "The subject is " + meetingItem.Subject + ".";
        }

有关详细信息,请参阅如何:以编程方式确定当前Outlook项

此外,您还可以考虑检查MailItem类的MailItem属性。MessageClass属性将该项链接到它所基于的窗体。选择项时,Outlook将使用消息类定位窗体并公开其属性,如“回复”命令。

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

https://stackoverflow.com/questions/35583132

复制
相关文章

相似问题

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