Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Outlook 2013附加模块-“;突然出现;电子邮件回复和转发窗口:界面类型是什么?_C#_Email_Types_Outlook Addin_Outlook 2013 - Fatal编程技术网

C# Outlook 2013附加模块-“;突然出现;电子邮件回复和转发窗口:界面类型是什么?

C# Outlook 2013附加模块-“;突然出现;电子邮件回复和转发窗口:界面类型是什么?,c#,email,types,outlook-addin,outlook-2013,C#,Email,Types,Outlook Addin,Outlook 2013,我一直在为Outlook 2013开发外接程序,目前发现很难找到Outlook 2013中回复和转发电子邮件时出现的“弹出窗口”的界面类型 例如:对于新电子邮件,接口类型为Outlook.MailItem,对于会议请求,接口类型为Outlook.AppointmentItem 我可以使用什么界面类型来标识Outlook 2013中回复和转发时显示的弹出窗口 它仍然是MailItem对象。使用查看live Outlook对象。在您的特定情况下,单击Outlook Spy功能区上的CurrentIt

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

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


我可以使用什么界面类型来标识Outlook 2013中回复和转发时显示的弹出窗口

它仍然是MailItem对象。使用查看live Outlook对象。在您的特定情况下,单击Outlook Spy功能区上的CurrentItem按钮。

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

        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 + ".";
        }
有关更多信息,请参阅


也可以考虑检查MaILTEM类的属性。MessageClass属性将项链接到它所基于的表单。选择项目后,Outlook使用message类查找表单并公开其属性,如回复命令。

我的经理与我坐在一起,对其进行了处理,幸好找到了解决方案。您可以使用以下代码访问“弹出”回复和转发窗口

//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;