zoukankan      html  css  js  c++  java
  • OutLook会议室预定提醒

    项目组采用敏捷开发管理,每两周一个迭代。写个工具做会议室预定。

    代码下载:https://download.csdn.net/download/linmilove/10547579

    AppointmentItem agendaMeeting = (AppointmentItem)new Microsoft.Office.Interop.Outlook.ApplicationClass().CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem);
    agendaMeeting.MeetingStatus = OlMeetingStatus.olMeeting;
    
    agendaMeeting.Location = localtion[0];
    agendaMeeting.Subject = string.Format("{0} {1:yyyy-MM-dd} {2}", txtSubject.Text, dtpStart.Value, agendaMeeting.Location);
    agendaMeeting.Body = txtBody.Text;
    agendaMeeting.Start = dtpStart.Value;
    agendaMeeting.End = dtpEnd.Value;
    
    Recipient recipient = agendaMeeting.Recipients.Add(localtion[1]);
    recipient.Type = (int)OlMeetingRecipientType.olRequired;
    System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("([A-Za-z0-9_-]+(\.\w+)*@(\w+\.)+\w{2,5})", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
    var match = regex.Matches(txtRecipients.Text);
    foreach (System.Text.RegularExpressions.Match item2 in match)
    {
        agendaMeeting.Recipients.Add(item2.Value);
    }
    ((_AppointmentItem)agendaMeeting).Send();
    Thread.Sleep(3000);
    AppointmentItem appt = (new Microsoft.Office.Interop.Outlook.ApplicationClass()).Session
        .GetDefaultFolder(OlDefaultFolders.olFolderCalendar).Items.Find(string.Format("[Subject]='{0}'", agendaMeeting.Subject)) as AppointmentItem;
    if (appt != null)
    {
        bool isDeclined = false;
        foreach (Recipient recip in appt.Recipients)
        {
            if (recip.Name.Contains("会议室") && recip.MeetingResponseStatus == OlResponseStatus.olResponseDeclined)
            {
                //预定失败
                isDeclined = true;
                break;
            }
        }
        if (!isDeclined)
        {
            break;
        }
    }

    界面预览:

  • 相关阅读:
    dbcc练习1
    查看底层硬件信息
    mkfs.xfs命令没找到
    Linux清空内存缓存
    常用CentOS 6/7 扩展源
    CentOS 6.x安装gcc 4.8/4.9/5.2
    根据SSH私钥(private key)计算SSH公钥(public key)
    Mac下Sublime Text Vim模式 方向键无法长按
    【转载】Hadoop和大数据:60款顶级大数据开源工具
    Linux Shell产生16进制随机数
  • 原文地址:https://www.cnblogs.com/linmilove/p/9326469.html
Copyright © 2011-2022 走看看