Re: ItemRemove event not fire when delete recurring appointment

  • Thread starter Ken Slovak - [MVP - Outlook]
  • Start date
Status
Not open for further replies.
K

Ken Slovak - [MVP - Outlook]

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.

"Jason" <a@a.com> wrote in message

news:Omsj%23%23pnJHA.3840@TK2MSFTNGP03.phx.gbl...
> 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?

>
 
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.
<kenslovak@mvps.org> wrote in message

news:%23LhdYnMoJHA.3984@TK2MSFTNGP02.phx.gbl...
> 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.

> >

>

> "Jason" <a@a.com> wrote in message
> news:Omsj%23%23pnJHA.3840@TK2MSFTNGP03.phx.gbl...
> > 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?
>

>>

>
 
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.

"Jason" <a@a.com> wrote in message

news:uJAgykNoJHA.3380@TK2MSFTNGP04.phx.gbl...
> 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.
 
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.
<kenslovak@mvps.org> wrote in message

news:eDO8yXOoJHA.3572@TK2MSFTNGP05.phx.gbl...
> 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.

> >

>

> "Jason" <a@a.com> wrote in message
> news:uJAgykNoJHA.3380@TK2MSFTNGP04.phx.gbl...
> > 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.

>
 
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.

"Jason" <a@a.com> wrote in message

news:O22g6fXoJHA.1172@TK2MSFTNGP05.phx.gbl...
> 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.
 
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.
<kenslovak@mvps.org> wrote in message

news:OBOZ4UYoJHA.1172@TK2MSFTNGP05.phx.gbl...
> 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.

> >

>

> "Jason" <a@a.com> wrote in message
> news:O22g6fXoJHA.1172@TK2MSFTNGP05.phx.gbl...
> >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.

>
 
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.

"Jason" <a@a.com> wrote in message

news:%23VvslgroJHA.1292@TK2MSFTNGP02.phx.gbl...
> 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.
 
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.
<kenslovak@mvps.org> wrote in message

news:%23tPKHWyoJHA.4028@TK2MSFTNGP03.phx.gbl...
> 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.

> >

>

> "Jason" <a@a.com> wrote in message
> news:%23VvslgroJHA.1292@TK2MSFTNGP02.phx.gbl...
> > 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.

>
 
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.

"Jason" <a@a.com> wrote in message

news:%23Td2gH2oJHA.5228@TK2MSFTNGP02.phx.gbl...
> 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.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
P Aborting ItemChange if ItemRemove Event Handler will be called nex Outlook VBA and Custom Forms 1
J dragging an calendar item to deleted folder does not trigger ItemRemove event Outlook VBA and Custom Forms 1
J Calendar events created on iPhone automatically changing default alert from 'None' to 'Time of Event' Using Outlook.com accounts in Outlook 0
T How to get an EVENT COLOR option in Outlook 2021 ? Using Outlook 0
J Cannot edit a calendar event received as an invitation Using Outlook 2
T Event Error on non existent Event. Using Outlook 2
J Event/Meeting in Outlook Does Not Align with SharePoint Calendar Using Outlook 5
P Calendar Day View only shows 1 all day event Using Outlook 0
G Event when creating task from mailitem Outlook VBA and Custom Forms 2
diver864 vba for a rule to automatically accept meeting requests with 'vacation' in subject, change to all-day event, change to free, don't send reply Outlook VBA and Custom Forms 1
J Outlook 2010 Outlook/Win7 Client logging Event ID 36887 Using Outlook 0
K Recurring all day annual event Using Outlook 3
P Restore an individual all-day recurring event Using Outlook 2
K VBA BeforeItemMove event create rule to always move to its folder. Outlook VBA and Custom Forms 4
K Working with Explorer.Close event Outlook VBA and Custom Forms 3
F Outlook 2016 call to Stop Timer Event Outlook VBA and Custom Forms 4
D Event ID issues Exchange Server Administration 2
J ItemChange event Outlook VBA and Custom Forms 11
T Outlook 2016 Calendar multiday event display Using Outlook 4
oliv- Treat once an email with the ItemAdd event in a shared mailbox Outlook VBA and Custom Forms 2
M Automatically create event in calendar when task is created Outlook VBA and Custom Forms 1
A UID field in iCal files - unique per-event or per-user or both? Using Outlook 2
D help with Item/Inspector close event Outlook VBA and Custom Forms 1
B on flag message event - create task Outlook VBA and Custom Forms 22
Diane Poremsky Change the All Day Event Default Free/Busy to "Busy" Using Outlook 3
C Calendar - Centering an event in Outlook? Using Outlook 1
J Outlook calendar...How to add an event or appointment without a border around it? Using Outlook 9
J Create Calendar Alert Event form Mail Subject line? Using Outlook 4
S Item Add Event fires intermittently Outlook VBA and Custom Forms 3
R Why is a meeting organizer me and not the creator of the event? Using Outlook 1
V Calendar event acting odd Using Outlook 7
G Capture "forward event" ? Outlook VBA and Custom Forms 11
P Change the Outlook.com "from" address for calendar event invites Using Outlook 9
20 Ton Squirrel Detect Application_Startup event completion Outlook VBA and Custom Forms 1
L Outlook 2007 All Day Event Using Outlook 27
I Event listener for deleted items Using Outlook 6
M Save Attachments Event? Using Outlook 0
Commodore Calendar Folder property is missing - Event 27 Using Outlook 11
G Quit event code - 2007 Using Outlook 3
J Capturing forward event when multiple items are selected Using Outlook 0
P Trying to get 'Calendar Name' to appear like 'Subject' and 'Location' in event Using Outlook 0
G What event happens when you open 2 copies of your inbox? Using Outlook 5
D Adding a participant automatically to a calendar event Using Outlook 1
H Changing Organizer of event (for single to total calendar move; long way ) Exchange Server Administration 4
N Combobox in outlook add ons toolbar not firing event on main window resized Using Outlook 3
D Extracting Location info from All Day Event in mailboxes into webpage Exchange Server Administration 3
H Conflicts with other event in calendar ( outlook 2007 &amp; 2010) Using Outlook 0
B Restoring Deleted Recurring Event AND Notes Using Outlook 8
Q Looking for Outlook 2010 Close Event Id Exchange Server Administration 1
S Outlook Recurring event Using Outlook 1

Similar threads

Back
Top