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

代码下载: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[];
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[]);
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();
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;
}
}

界面预览:

最新文章

  1. Android APK的安装
  2. 旅图beta版 asp.net web api 单元测试
  3. 如何重启Activity
  4. Jersey+Spring+Maven(转)
  5. iOS开发 Xcode中的Info.plist字段含义
  6. [转]fatal error: iostream.h: No such file or directory
  7. CSS+DIV+JQuery实际的视频汇总
  8. JS阻塞以及CSS阻塞
  9. js压缩文件读取处理
  10. django报错Manager isn't accessible via UserInfo instances
  11. 网页布局之grid
  12. react路由
  13. python语法风格
  14. bzoj4383(拓扑排序)
  15. CAS5.3.X 配置备忘
  16. android textview字体加粗 Android studio最新水平居中和垂直居中
  17. js 的this
  18. yum 私有仓库
  19. Js中对id和class属性进行模糊查询
  20. ubuntu 16.04 install wine

热门文章

  1. jmeter做websocket协议的接口测试
  2. 【LeetCode】堆 heap(共31题)
  3. electron打包成.exe后限制只启动一个应用
  4. 2019年7月25日 shell练习--PAT题目1006:换个格式输出整数(失败案例)
  5. HTML5测试(二)
  6. Kotlin使用率达35%,Java要退位了?
  7. Tomcat的安装、配置常见问题
  8. LSTM细节
  9. (44)FreeRTOS学习之一
  10. wannafly 挑战赛9 E 组一组 (差分约束)