Appointment without Appointment Dialog

Add-in Express™ Support Service
That's what is more important than anything else

Appointment without Appointment Dialog
Programatically entering an appointment without showing dialog 
Darrin Edwards


Guest


Hi guys,

I am attempting to create an appointment from a VSTO ...

I have a custom dialog for entering the requisite data for the appointment which pulls information in from a database - when the ok button in the custom dialog is pressed, a procedure executes filling in information and then saves the appointment item ... similar to the following ....

private void CreateAppointmentUsingCreateItem()
{
Outlook.AppointmentItem appItem = OutlookApp.CreateItem(
Outlook.OlItemType.olAppointmentItem) as Outlook.AppointmentItem;
if (appItem != null)
{
// insert item details - start end etc
// ...
//
appItem.Save();
//appItem.Display(true);
Marshal.ReleaseComObject(appItem);
}
}

But, the dialog still shows.

How can I avoid the dialog showing ?

MTIA

Darrin
Posted 10 Aug, 2019 21:49:24 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Darrin,

Do you mean your own dialog form (System.Windows.Forms.Forms)? If yes, you can use the Close() method:
https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.form.close
Posted 12 Aug, 2019 03:02:28 Top