A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

ItemRemove event not fire when delete recurring appointment



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 6th 09, 10:06 PM posted to microsoft.public.outlook.program_addins
Jason
external usenet poster
 
Posts: 41
Default ItemRemove event not fire when delete recurring appointment

Symptom:
When deleting an entire appointment series, the ItemRemove event always
fires. - That is correct.

When deleting the 1st item from a recurring appointment series, the
ItemRemove event does fire. - That is correct.

However, when deleting the other items (2nd to the last) from a recurring
appointment series, the ItemRemove event does not fire. Instead, ItemChange
event is fired. It does not matter if the 1st item has been removed or not.

Question:
In ItemChange event handler, how to detect that the event is actually an
ItemRemove, not ItemChange?

In the Outlook.RecurrencePattern.Exception collection, the Deleted property
is true for all objects in it, when doing delete and update. Can't see
difference between delete and update. What are the real flags/identifiers?


Ads
  #2  
Old March 9th 09, 04:15 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default ItemRemove event not fire when delete recurring appointment

I can't repro this.

If I change the start time of an item in a recurring series it is in
Exceptions, but it does not show Deleted == true.

I set up a series of appointments, 10 in all, and deleted the first 3. I
then modified another instance for start time. In Exceptions I had 3 marked
as Deleted == true, 1 as Deleted == false, exactly what I would have
expected.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Jason" wrote in message
...
Symptom:
When deleting an entire appointment series, the ItemRemove event always
fires. - That is correct.

When deleting the 1st item from a recurring appointment series, the
ItemRemove event does fire. - That is correct.

However, when deleting the other items (2nd to the last) from a recurring
appointment series, the ItemRemove event does not fire. Instead,
ItemChange event is fired. It does not matter if the 1st item has been
removed or not.

Question:
In ItemChange event handler, how to detect that the event is actually an
ItemRemove, not ItemChange?

In the Outlook.RecurrencePattern.Exception collection, the Deleted
property is true for all objects in it, when doing delete and update.
Can't see difference between delete and update. What are the real
flags/identifiers?



  #3  
Old March 9th 09, 06:02 PM posted to microsoft.public.outlook.program_addins
Jason
external usenet poster
 
Posts: 41
Default ItemRemove event not fire when delete recurring appointment

You are right Ken.

The deleted items remain in the Exception collection and have the deleted
property set to true and the Appointment set to null.

The Exception collection contains both modified and deleted items.

With these knowledge, I am still not able to identify which item is being
modified or deleted, and what operation (modification or deletion) is
performed? And worse yet, does the operation apply on the entire series or
just single occurrence?

The Appointment.EntryId is used for the entire series.
NO properties of the Exception object is useful.


"Ken Slovak - [MVP - Outlook]" wrote in message
...
I can't repro this.

If I change the start time of an item in a recurring series it is in
Exceptions, but it does not show Deleted == true.

I set up a series of appointments, 10 in all, and deleted the first 3. I
then modified another instance for start time. In Exceptions I had 3
marked as Deleted == true, 1 as Deleted == false, exactly what I would
have expected.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Jason" wrote in message
...
Symptom:
When deleting an entire appointment series, the ItemRemove event always
fires. - That is correct.

When deleting the 1st item from a recurring appointment series, the
ItemRemove event does fire. - That is correct.

However, when deleting the other items (2nd to the last) from a recurring
appointment series, the ItemRemove event does not fire. Instead,
ItemChange event is fired. It does not matter if the 1st item has been
removed or not.

Question:
In ItemChange event handler, how to detect that the event is actually an
ItemRemove, not ItemChange?

In the Outlook.RecurrencePattern.Exception collection, the Deleted
property is true for all objects in it, when doing delete and update.
Can't see difference between delete and update. What are the real
flags/identifiers?





  #4  
Old March 9th 09, 07:34 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default ItemRemove event not fire when delete recurring appointment

Exception.AppointmentItem and Exception.OriginalDate give you enough
information so you can see which instance was modified/deleted in the
Exceptions collection.

For example, get the Start of the item passed to you in ItemChange() and
compare that to each Exception.OriginalDate in the Exceptions collection.

Exception.AppointmentItem will give you back the recurring instance,
although it's not valid for deleted instances.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Jason" wrote in message
...
You are right Ken.

The deleted items remain in the Exception collection and have the deleted
property set to true and the Appointment set to null.

The Exception collection contains both modified and deleted items.

With these knowledge, I am still not able to identify which item is being
modified or deleted, and what operation (modification or deletion) is
performed? And worse yet, does the operation apply on the entire series or
just single occurrence?

The Appointment.EntryId is used for the entire series.
NO properties of the Exception object is useful.


  #5  
Old March 10th 09, 12:58 PM posted to microsoft.public.outlook.program_addins
Jason
external usenet poster
 
Posts: 41
Default ItemRemove event not fire when delete recurring appointment

I need to know what is happening right now, not the past history. I need
current item and current action. Look like they are not there. I'd have to
give up on this.

When an item is changed, the original date will be persisted into Exception
object. When another item is modified, there will be another Exception
object with original date. How do we know which is the newest item modified,
or deleted?

Going through Exceptions collection could be time consuming.

"Ken Slovak - [MVP - Outlook]" wrote in message
...
Exception.AppointmentItem and Exception.OriginalDate give you enough
information so you can see which instance was modified/deleted in the
Exceptions collection.

For example, get the Start of the item passed to you in ItemChange() and
compare that to each Exception.OriginalDate in the Exceptions collection.

Exception.AppointmentItem will give you back the recurring instance,
although it's not valid for deleted instances.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Jason" wrote in message
...
You are right Ken.

The deleted items remain in the Exception collection and have the deleted
property set to true and the Appointment set to null.

The Exception collection contains both modified and deleted items.

With these knowledge, I am still not able to identify which item is being
modified or deleted, and what operation (modification or deletion) is
performed? And worse yet, does the operation apply on the entire series
or just single occurrence?

The Appointment.EntryId is used for the entire series.
NO properties of the Exception object is useful.




  #6  
Old March 10th 09, 02:08 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default ItemRemove event not fire when delete recurring appointment

I fail to see a problem. Iterating Exceptions is not a big deal, nor is
getting recurring instances if you know the start date of the instance or
are incrementing your iteration of the recurrences collection. I do that in
code for a number of my applications. When you get the event you have the
item being changed, it's not a big deal to match it to something in
Exceptions.

If an item is deleted you can't get AppointmentItem for it, if not deleted
you can get AppointmentItem and then check for LastModifiedTime if you want
to see when the Exception was modified.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Jason" wrote in message
...
I need to know what is happening right now, not the past history. I need
current item and current action. Look like they are not there. I'd have to
give up on this.

When an item is changed, the original date will be persisted into
Exception object. When another item is modified, there will be another
Exception object with original date. How do we know which is the newest
item modified, or deleted?

Going through Exceptions collection could be time consuming.


  #7  
Old March 12th 09, 03:10 AM posted to microsoft.public.outlook.program_addins
Jason
external usenet poster
 
Posts: 41
Default ItemRemove event not fire when delete recurring appointment

Let me clarify again. I need to be able to identify the item that was
modified or deleted, in other words, I need the ID of single occurrence,
otherwise I can not sync it with other applications. Unfortunately, the ID
is not there. EntryID is just for the whole series. There is no ID for each
occurrence. (ID may be hidden) There is no way to know which item was
modified or deleted. Although it does not matter to work on Outlook itself
as you have done, there is no way to sync Outlook's single occurence with
other application. We can only fall back, treating recurrence as a whole.

In addition to this limitation, Outlook's recurrence design also has another
big problem.

"Ken Slovak - [MVP - Outlook]" wrote in message
...
I fail to see a problem. Iterating Exceptions is not a big deal, nor is
getting recurring instances if you know the start date of the instance or
are incrementing your iteration of the recurrences collection. I do that in
code for a number of my applications. When you get the event you have the
item being changed, it's not a big deal to match it to something in
Exceptions.

If an item is deleted you can't get AppointmentItem for it, if not deleted
you can get AppointmentItem and then check for LastModifiedTime if you
want to see when the Exception was modified.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Jason" wrote in message
...
I need to know what is happening right now, not the past history. I need
current item and current action. Look like they are not there. I'd have to
give up on this.

When an item is changed, the original date will be persisted into
Exception object. When another item is modified, there will be another
Exception object with original date. How do we know which is the newest
item modified, or deleted?

Going through Exceptions collection could be time consuming.




  #8  
Old March 12th 09, 04:16 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default ItemRemove event not fire when delete recurring appointment

Recurrences do not exist as independent instances of an appointment. They
only exist as calculations based on the master appointment's
RecurrencePattern. The Exceptions collection contains those calculated
instances that were modified or deleted. That's the way it is and has been
since Schedule+, it cannot be changed without breaking all existing
recurring items and recurrence code.

Based on the information in this thread you should be able to identify which
occurrences were modified, which were deleted and which have the original
settings. It takes work to do that but that's life. That you can't get an
individual EntryID is due to the nature of the design but hasn't handicapped
other developers working with recurrences.

What you want does not exist. Therefore you either can't do what you want,
must change how you synch or come up with some other workaround.

There are many problems with the existing implementation, but again that's
not changing.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Jason" wrote in message
...
Let me clarify again. I need to be able to identify the item that was
modified or deleted, in other words, I need the ID of single occurrence,
otherwise I can not sync it with other applications. Unfortunately, the ID
is not there. EntryID is just for the whole series. There is no ID for
each occurrence. (ID may be hidden) There is no way to know which item was
modified or deleted. Although it does not matter to work on Outlook itself
as you have done, there is no way to sync Outlook's single occurence with
other application. We can only fall back, treating recurrence as a whole.

In addition to this limitation, Outlook's recurrence design also has
another big problem.


  #9  
Old March 12th 09, 11:25 PM posted to microsoft.public.outlook.program_addins
Jason
external usenet poster
 
Posts: 41
Default ItemRemove event not fire when delete recurring appointment

I realized the Original time of Exception object can be used as ID. It is
different/unique for each Exception. In a series, each occurrence's start
time is different/unique. It is calculated based on the series start date
time, adding up time difference.

Adding an ID property to Exception object will not break any thing.
Microsoft should do it.
The ID can have already been used as the key of the Exception object in the
Exceptions collection. It is just not yet exposed.

Anyway I gave up. Anything leads to messy code is not worth of
implementation. It will cost you far more than initial creation. The cost of
product maintenance, and the cost of user learning and using the product,
get scary down the road.


"Ken Slovak - [MVP - Outlook]" wrote in message
...
Recurrences do not exist as independent instances of an appointment. They
only exist as calculations based on the master appointment's
RecurrencePattern. The Exceptions collection contains those calculated
instances that were modified or deleted. That's the way it is and has been
since Schedule+, it cannot be changed without breaking all existing
recurring items and recurrence code.

Based on the information in this thread you should be able to identify
which occurrences were modified, which were deleted and which have the
original settings. It takes work to do that but that's life. That you
can't get an individual EntryID is due to the nature of the design but
hasn't handicapped other developers working with recurrences.

What you want does not exist. Therefore you either can't do what you want,
must change how you synch or come up with some other workaround.

There are many problems with the existing implementation, but again that's
not changing.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Jason" wrote in message
...
Let me clarify again. I need to be able to identify the item that was
modified or deleted, in other words, I need the ID of single occurrence,
otherwise I can not sync it with other applications. Unfortunately, the
ID is not there. EntryID is just for the whole series. There is no ID for
each occurrence. (ID may be hidden) There is no way to know which item
was modified or deleted. Although it does not matter to work on Outlook
itself as you have done, there is no way to sync Outlook's single
occurence with other application. We can only fall back, treating
recurrence as a whole.

In addition to this limitation, Outlook's recurrence design also has
another big problem.




  #10  
Old March 13th 09, 03:28 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default ItemRemove event not fire when delete recurring appointment

Since the object references and properties of members of the Exceptions
collection are held in the RecurrencePattern there's no way to add anything
to that without breaking the existing RecurrencePattern and any code that
references or works with it. Until MS completely redoes that at some point
in time, if ever, there's no way to do what you suggest.

I still don't understand the problem. Yes the code to work with
RecurrencePattern and recurrences can get complicated, but once written it's
done and requires almost no maintenance. I have been working with that and
with recurrences in my Reminder Manager addin for more than 6 years now. It
definitely can be done, and I know of many other applications that do it.

Whether or not it's justified for you is another matter.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Jason" wrote in message
...
I realized the Original time of Exception object can be used as ID. It is
different/unique for each Exception. In a series, each occurrence's start
time is different/unique. It is calculated based on the series start date
time, adding up time difference.

Adding an ID property to Exception object will not break any thing.
Microsoft should do it.
The ID can have already been used as the key of the Exception object in
the Exceptions collection. It is just not yet exposed.

Anyway I gave up. Anything leads to messy code is not worth of
implementation. It will cost you far more than initial creation. The cost
of product maintenance, and the cost of user learning and using the
product, get scary down the road.


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I change a recurring appointment to all day event? BobC Outlook - Calandaring 5 September 29th 09 03:57 AM
ItemRemove event stop firing, ItemAdd & ItemChange still work Jason Add-ins for Outlook 3 March 5th 09 12:24 AM
How do I delete a recurring event? JuliaBrown Outlook - Calandaring 2 August 17th 06 12:58 PM
Outlook VSTO Appointment Item Delete Event lg Add-ins for Outlook 0 July 31st 06 11:35 AM
script event does not fire urs Outlook - General Queries 2 March 1st 06 05:55 PM


All times are GMT +1. The time now is 07:20 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.