コード例 #1
0
        /// <summary>
        /// TaskRequestDeclineItemから、宛先(Recipient)のリスト取得する
        /// </summary>
        /// <param name="Item">TaskRequestDeclineItemオブジェクト</param>
        /// <returns>List<Outlook.Recipient></returns>
        private static List <Outlook.Recipient> GetRecipientList(Outlook.TaskRequestDeclineItem item)
        {
            //相手からの辞退メールなので、必ず自分宛という想定
            List <Outlook.Recipient> recipientList = new List <Outlook.Recipient>();

            recipientList.Add(Globals.ThisAddIn.Application.Session.CurrentUser);
            return(recipientList);
        }
コード例 #2
0
 /// <summary>
 /// 送信者の情報(Dto)を取得する
 /// </summary>
 /// <param name="Item">Outlookアイテムオブジェクト</param>
 /// <returns>送信者の宛先情報インスタンス(送信者が取得できない場合null)</returns>
 public static RecipientInformationDto GetSenderInfomation(object Item)
 {
     if (Item is Outlook.MailItem)
     {
         Outlook.MailItem mail = (Item as Outlook.MailItem);
         return(GetSenderInformation(mail));
     }
     else if (Item is Outlook.MeetingItem)
     {
         Outlook.MeetingItem meeting = Item as Outlook.MeetingItem;
         return(GetSenderInformation(meeting));
     }
     else if (Item is Outlook.AppointmentItem)
     {
         Outlook.AppointmentItem appointment = Item as Outlook.AppointmentItem;
         return(GetSenderInformation(appointment));
     }
     else if (Item is Outlook.ReportItem)
     {
         Outlook.ReportItem report = Item as Outlook.ReportItem;
         return(GetSenderInformation(report));
     }
     else if (Item is Outlook.SharingItem)
     {
         Outlook.SharingItem sharing = Item as Outlook.SharingItem;
         return(GetSenderInformation(sharing));
     }
     else if (Item is Outlook.TaskItem)
     {
         Outlook.TaskItem task = Item as Outlook.TaskItem;
         return(GetSenderInformation(task));
     }
     else if (Item is Outlook.TaskRequestItem)
     {
         Outlook.TaskRequestItem taskRequest = Item as Outlook.TaskRequestItem;
         return(GetSenderInformation(taskRequest));
     }
     else if (Item is Outlook.TaskRequestAcceptItem)
     {
         Outlook.TaskRequestAcceptItem taskRequestAcceptItem = Item as Outlook.TaskRequestAcceptItem;
         string mailHeader = GetMailHeader(taskRequestAcceptItem.PropertyAccessor);
         return(GetSenderInformationFromMailHeader(mailHeader));
     }
     else if (Item is Outlook.TaskRequestDeclineItem)
     {
         Outlook.TaskRequestDeclineItem taskRequestDeclineItem = Item as Outlook.TaskRequestDeclineItem;
         string mailHeader = GetMailHeader(taskRequestDeclineItem.PropertyAccessor);
         return(GetSenderInformationFromMailHeader(mailHeader));
     }
     else
     {
         throw new NotSupportedException("未対応のOutook機能です。");
     }
 }