Cancel a meeting of O365 in outlook2010 failed when the send event customized

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

Cancel a meeting of O365 in outlook2010 failed when the send event customized
deleted in local but remained in server after closing the cancellation window 
advantest


Guest


Hi, Team

Currently, I'm developping an add-in for outlook2010/2013.
The add-in's function is to display the Recipients list after clicking the send button when create a meeting(not appointment), and there're two button in the list window. When clicking the button "yes", the meeting application will be sent to server. And when clicking the button "no", it just makes the list window be closed.

This function need also be supported when cancelling the existed meeting. But now the issue is the meeting item will be deleted from my local calendar but still remained in Server(I asked another person view the meeting schedule) when I do the following operation:

1. Open the existed meeting item from my calendar
2. Click the Cancel Meeting Button in the [Meeting] ribbon tab
3. Click the Send Cancellation Button
4. The addin works and display the Recipients list
5. Click the NO button in the list window, window closed
6. Not cancel this meeting, just click the "X" close button in the right top of Meeting inspector window

For my customize send event coding is like :

private void adxOutlookAppEvents1_ItemSend(object sender, ADXOlItemSendEventArgs e)
{
bool isCancel = true;

//******************
//Here to showDialog the list window and get the list of Recipients
//******************

if (mylistwindow.DialogResult == DialogResult.Cancel)
{
isCancel = true;
}
else if (mylistwindow.DialogResult == DialogResult.OK
|| mylistwindow.DialogResult == DialogResult.Yes)
{
isCancel = false;
}

e.Cancel = isCancel;
}

When clicking the NO button, the e.Cancel will be set into True.

The addin is also used for sending a mail and works fine when closing the new mail inspector.
I found my calendar will keep the meeting item until I close the cancel meeting inspector.
But I don't know in which event the local operation of deleting meeting item will be executed? Is there another Cancel parameters that I must set it in code or how can I code for keep the local meeting item when just closing the cancel meeting inspector without cancelling it actually.

Please give me the help.
Posted 23 Jun, 2015 06:48:50 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
advantest writes:
But now the issue is the meeting item will be deleted from my local calendar but still remained in Server


Will the same occur if you turn your add-in off?

I suppose sending an email when cancelling a meeting is required for other meeting participants to find out that the meeting is cancelled.


Andrei Smolin
Add-in Express Team Leader
Posted 23 Jun, 2015 08:08:23 Top
advantest


Guest


Dear Andrei

I've tired it without the add-ins.
The result is different and it looks like correct.

1. Open the existed meeting item from my calendar
2. Click the Cancel Meeting Button in the [Meeting] ribbon tab
//3. Click the Send Cancellation Button
//4. The addin works and display the Recipients list
//5. Click the NO button in the list window, window closed
6. Not cancel this meeting, just click the "X" close button in the right top of Meeting inspector window

=> For 3, if click the Send Cancellation Button, the cancel mail will be sent out, and the meeting item will be deleted both from my local calendar and server(check by my calendar and another person's account).

=> If not click the Send Cancellation Button, just go to 6, to click the "X" close button, a warning messagebox will display:
"The meeting is canceled. Select on of the following: 1. Send cancellation ; 2. Don't cancel the meeting and close". But the warning selection messagebox doesn't display when add-ins used.

I think maybe there's some parameters (bool cancel) or events occurred during the time from Send Cancellation Button Clicked to Meeting Inspector Window Closed. But in my code to show list window and get Recipients, there're no operation to change the olMeetingStatus or other properties which maybe control the meeting status.
Posted 23 Jun, 2015 10:31:18 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hello Tai,

I think that your code (e.Cancel = isCancel;) prevents sending the cancellation email and that is why the meeting item remains on the server and in another person's calendars. Please check this. Also, I would suggest that you change the default value as follows:

private void adxOutlookAppEvents1_ItemSend(object sender, ADXOlItemSendEventArgs e)
{
    bool isCancel = false; 
// ...
Posted 24 Jun, 2015 05:02:14 Top
advantest


Guest


Hello Dmitry,

Thanks for your reply.
But I don't think the e.Cancel is the key to fix my problem, and in fact my code now is correct for my logic.

What I want to do is:
1. Open a meeting from my calendar
2. Click the [Cancel Meeting] button in the left top, in the Meeting Tab
3. The inspector changed, and Send Button's caption changed into [Send Cancellation]
4. Click the [Send Cancellation] button, show my add-in to list the Recipients
5. The add-in works fine, then I click the [NO] button in my add-in window to close the addin
6. Click the [X] close button in the right top of meeting inspector
7. The meeting inspector closed
8. The closed meeting still in my calendar
9. Checked by another person, the meeting still in server

But, the problem now is, when I follow this step to operate
In the 8, the meeting item missed from my calendar, and in 9 it's OK.

Here is my code for more detail:
private void adxOutlookAppEvents1_ItemSend(object sender, ADXOlItemSendEventArgs e)
{
bool isCancel = true;
ConfirmAddress(e.Item, ref isCancel); //display the addin window and get Recipients list
e.Cancel = isCancel;
}

private void ConfirmAddress(object item, ref bool cancel)
{
//item which addins will check
Outlook.MeetingItem meetitem = item as Outlook.MeetingItem;
if (meetitem != null)
{
try
{
//main window
ConfirmForm dd = new ConfirmForm(item, CurrentUser); // add-in window
dd.BringToFront();
dd.ShowDialog();

if (dd.DialogResult == DialogResult.Cancel) // click the [NO] button
{
cancel = true;
}
else if (dd.DialogResult == DialogResult.OK // click the [Yes] button
|| dd.DialogResult == DialogResult.Yes)
{
cancel = false;
}
else
{
cancel = true;
}
}
catch (Exception e)
{
//log
ErrorLogger.WriteLog(e.Message, e.StackTrace, e.InnerException == null ? "NULL" : e.InnerException.ToString(), CurrentUser);
cancel = true;
}
}

I don't know when the operation of delete local meeting item from local calendar will occur, I need know the event to cancel it too like cancel it for server.
Posted 24 Jun, 2015 05:29:37 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hello Tai,

Thank you for the explanations. Try to get access to the original appointment item (see the https://msdn.microsoft.com/en-us/library/office/ff867189.aspx), change its https://msdn.microsoft.com/EN-US/library/office/ff869205.aspx and save the appointment.
Posted 24 Jun, 2015 09:19:51 Top
advantest


Guest


Hello Dmitry

Thank you for your sugguestion.But it doesn't work.

I have tried to add those methods into my code, but result is same bad.

dd.ShowDialog();

if (dd.DialogResult == DialogResult.Cancel)
{
meetitem.GetAssociatedAppointment(false).MeetingStatus = Outlook.OlMeetingStatus.olMeeting;
meetitem.GetAssociatedAppointment(false).Save();

cancel = true;
}
else if (dd.DialogResult == DialogResult.OK
|| dd.DialogResult == DialogResult.Yes)
{
cancel = false;
}

In fact, whatever I choose the para (true or false) for GetAssociatedAppointment, the result is always same and the meeting item is still deleted from local calendar. I can find the deleted meeting items in the outlook's [Deleted Items] folder.
Posted 24 Jun, 2015 21:57:05 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hello Tai,

I have reproduced the problem but have not found any solution so far. All my attempts to retain a meeting item in the local calendar failed. I will continue investigating this issue and inform you if I find something.
Posted 25 Jun, 2015 08:38:45 Top
advantest


Guest


Hello Dmitry

Sorry for replay so late and thank you very much for your greate support.
This issue seems very strange. I have asked help for Mircosoft Partner Team, but also no process.
The microsoft engineer told me that the deletion of local meeting item in calendar has been done after clicked the [Cancel Meeting] button in step 2. It seems outlook only need to submit this change when the meeting inspector be closed. The [Send Cancellation] is to send email(request) to server(mainly the meeting room in my case) and other attandees to "say about the cancel".
They suggest me should show my addin window function when clicking the Cancel Meeting button not the Send Cancellation button. This idea seems not bad, but conflict with my request. If the Recipients list shows when Step 2, User can change the email's [TO] content before sending cancellation to send email to others which not listed in addin list which user has confirmed. This action is dangerous for my company business policy.

So, please help check this issue.
Keep contact. I'll update my side information for you if any process.
Posted 26 Jun, 2015 22:13:52 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hello Tai,

Please see the results of my investigation below. Here is a list of Outlook events that are fired in response to my/user action.

** Action: Click the Cancel Meeting button
Item.BeforeDelete
Item.PropertyChange (MeetingStatus)
Item.PropertyChange (BusyStatus)
Item.PropertyChange (NetMeetingAutoStart)
Item.PropertyChange (ReminderSet)


** Action: Click the close ( X ) button to close the inspector window
Item.Close
+The dialog "The meeting is canceled. Select one of the following:" is shown


** Action: Select the "don't cancel the meeting and close" option and click OK
Item.PropertyChange (RequiredAttendees)
Item.PropertyChange (OptionalAttendees)
Item.PropertyChange (Resources)
Item.BeforeRead
Item.PropertyChange (RequiredAttendees)
Item.PropertyChange (OptionalAttendees)
Item.PropertyChange (Resources)
Item.BeforeRead
+ The inspector is closed


** Action: Select the "Send cancellation" option and click OK
Item.BeforeCheckNames
Item.PropertyChange (RequiredAttendees)
Item.PropertyChange (OptionalAttendees)
Item.PropertyChange (Resources)
Calendar.BeforeItemMove
Item.Write
Item.BeforeCheckNames
Item.AfterWrite
Item.Send
Item.BeforeCheckNames
Application.ItemSend
Item.Write
Item.BeforeCheckNames
Item.AfterWrite
Calendar.ItemChange
Calendar.ItemChange
Calendar.ItemRemove
DeletedItems.ItemAdd
DeletedItems.ItemChange
DeletedItems.ItemChange
+ The inspector is closed and the meeting item is deleted from the calendar
+ Another user sees that the meeting was cancelled (the MeetingStatus property == olMeetingReceivedAndCanceled), but the meeting item persists in his/her calendar


So, as you can see, the Microsoft engineer is right and the BeforeDelete event is the first event in this sequence. But I think the BeforeItemMove event of the Calendar folder is a much more interesting one and probably you can use it in your solution.
Posted 29 Jun, 2015 04:53:35 Top