我有一个带有按钮(C#)的Windows窗体。此按钮应打开如下所示的Outlook Meeting窗口:

c# - 使用按钮打开Outlook session 窗口-LMLPHP

该按钮必须打开窗口,以便用户可以创建会议。你能帮助我吗 ?

最佳答案

您可以将WinForms应用程序与按钮一起使用,并在单击按钮时执行以下代码:

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

appointmentItem.Subject = "Meeting Subject";
appointmentItem.Body = "The body of the meeting";
appointmentItem.Location = "Room #1";
appointmentItem.Start = DateTime.Now;
appointmentItem.Recipients.Add("[email protected]");
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);


它将从Outlook打开约会窗口。

要使此工作正常,您需要对Microsoft.Office.Interop.Outlook的引用

10-04 14:48