我正在尝试让我的应用程序打开带有一些预填充字段的 Outlook session 窗口。
我发现这个问题已经有人问了here . 但是,答案中提供的代码(工作正常)不会打开 session 窗口,而是会打开约会窗口。这是在 Outlook 中以不同方式处理的两件不同的事情,而我确实需要 session 窗口。
有什么方法可以做到这一点,还是我必须先打开约会窗口,然后邀请其他人将其变成 session ?
最佳答案
像在另一个问题中一样创建约会,但随后设置约会的 MeetingStatus
属性。
Microsoft.Office.Interop.Outlook.Application outlookApplication = new Microsoft.Office.Interop.Outlook.Application(); ;
Microsoft.Office.Interop.Outlook.AppointmentItem appointmentItem = (Microsoft.Office.Interop.Outlook.AppointmentItem)outlookApplication.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem);
// This line was added
appointmentItem.MeetingStatus = Microsoft.Office.Interop.Outlook.OlMeetingStatus.olMeeting;
appointmentItem.Subject = "Meeting Subject";
appointmentItem.Body = "The body of the meeting";
appointmentItem.Location = "Room #1";
appointmentItem.Start = DateTime.Now;
appointmentItem.Recipients.Add("test@test.com");
appointmentItem.End = DateTime.Now.AddHours(1);
appointmentItem.ReminderSet = true;
appointmentItem.ReminderMinutesBeforeStart = 15;
appointmentItem.Importance = Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh;
appointmentItem.BusyStatus = Microsoft.Office.Interop.Outlook.OlBusyStatus.olBusy;
appointmentItem.Recipients.ResolveAll();
appointmentItem.Display(true);
关于c# - 是否可以直接打开Outlook session 窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42676261/