Question

sureshh on Mon, 15 May 2017 22:25:23


Hello Techies,

I have a situation here; I need to handle some operation only once with proper state on click of Send button of meeting item. Below is brief about situation here. Any inputs are much appreciated.

Case 1:

1. Open new meeting window, then enter To field, Subject, location details

2. Click on Save button or File->Save; and close that window

3. Reopen that meeting, update subject; click on Save button and then here below events occurs

Appointment_Write, and then Appointment_AfterWrite event

Now in Appointment_AfterWrite, I have SomeOperation(state1) called

Here Case 1 is all perfect.

Case 2:

1. Open new meeting window, then enter To field, Subject, location details

2. Click on Save button or File->Save; and close that window

3. Reopen that meeting, update subject; Click on Send button; and then here below events occurs

Appointment_Write, Appointment_AfterWrite, and then Appointment_Send event occurs. Look like everytime these events occurs in sequence.

Now in Appointment_AfterWrite, I have SomeOperation(state1) called, and in Send event I have SomeOperation(state2) called

In this case, I actually want to make SomeOperation(State2) only and not SomeOperation(state1)

How can I handle this situation? I was thinking of customizing Send button, but look like built-in Send button cannot be customized here.


sureshh...





Sponsored



Replies

Deepak Saradkumar Panchal on Tue, 16 May 2017 03:36:43


Hi sureshh,

I can see that you have 2 different approaches.

you first approach works fine.

but your second approach not working because of the sequence of events execution.

yes we can't automate any inbuilt control or options.

further I try to compare your both cases.

it looks like both cases are same.

so in first case also send event will execute. how you handle that?

it looks like we can't distinguish between these 2 approach. so it is hard to fulfil this requirement.

it is better that your change your logic.

Regards

Deepak


MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


sureshh on Tue, 16 May 2017 12:41:50


Hi Deepak,

Thanks for getting back. If you see, in case 1, we are not hitting Send button and so there is no Send event at all but Write event followed by After_Write event only occurs.

Thanks.

Deepak Saradkumar Panchal on Wed, 17 May 2017 08:36:25


Hi sureshh,

I try to find the way to suppress AppointmentItem.AfterWrite Event when send button click.

but unfortunately no any way is available to suppress it.

AppointmentItem.AfterWrite Event (Outlook)

it is not cancelable event. we can't stop it.

Regards

Deepak

sureshh on Wed, 17 May 2017 17:49:29


Thanks Deepak. Appreciate it.

Does anyone else have any inputs here to handle this situation?

Thanks.

sureshh on Thu, 25 May 2017 14:03:54


Hello Techies,

Revisiting this thread to see if anybody else has any other suggestions here? Or there is no solution to this situation?

Please advise.

Thanks.

Dmitry Streblechenko _MVP_ on Thu, 25 May 2017 14:30:38


The bigger question is why do you depend on a particular order off events? You really need to re-architect how you handle the events.