使用按钮打开Outlook会议窗口 [英] Open the Outlook meeting window with a button

查看:262
本文介绍了使用按钮打开Outlook会议窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I got a Windows form with a button (C#). This button should open the Outlook Meeting window which looks like this:

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

The button has to open the window so the user can create a Meeting. Can you help me ?

推荐答案

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

You can use your WinForms Application with a button and execute this code on button click:

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

它将从Outlook中打开一个约会窗口.

It will open an appointment window from Outlook.

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

To get this working you need a reference to Microsoft.Office.Interop.Outlook

这篇关于使用按钮打开Outlook会议窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆