xCrice
xCrice

Reputation: 13

Open the Outlook meeting window with a button

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

Outlook Meeting window

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

Upvotes: 1

Views: 2109

Answers (2)

Shahar Shokrani
Shahar Shokrani

Reputation: 8762

The @Shamshiel answer will open an appointment window!

For meeting window, you must set the appointmentItem attribute of MeetingStatus.

appointmentItem.MeetingStatus = Microsoft.Office.Interop.Outlook.OlMeetingStatus.olMeeting;

Note that you can not create the MeetingItem Object: (msdn)

Unlike other Microsoft Outlook objects, you cannot create this object. It is created automatically when you set the MeetingStatus property of an AppointmentItem object to olMeeting and send it to one or more users. They receive it in their inboxes as a MeetingItem.

Use the GetAssociatedAppointment method to return the AppointmentItem object associated with a MeetingItem object, and work directly with the AppointmentItem object to respond to the request.

Upvotes: 2

Shamshiel
Shamshiel

Reputation: 2211

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

It will open an appointment window from Outlook.

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

Upvotes: 4

Related Questions