calendar folder ItemAdd event problem

A

asaf lahav

Hello everybody,

I am having trouble in handling the item add event on outlook calendar item.

I am handling the ItemAdd and ItemChaneg events on the outlook calendar
folder in order to change the appointment items properties.
The problem is that the outlook fires the ItemChange right after the item
add event even for new items (probably because the item is already persisted
to the calendar folder when i get the item Add event. and then it fires the
item_Change even as well because of the changes i inflicted on the item).
The outlook fires the ItemChange event twice. which leaves me with out any
way to know if the change event is fired for a new item or an old item that
was just changed since i can't use a flag (the change event is fired twice
for each new item and i don't know if its going to always act the same).

Thanks in advance,
Asaf Lahav
 
K

Ken Slovak - [MVP - Outlook]

Are you changing the item in ItemAdd at all? I don't get both events when an
item is added to a folder unless I modify the item in the ItemAdd code. You
could set a module level variable of some kind based on the item in ItemAdd,
perhaps containing the EntryID of the item and then check and clear that
variable when ItemChange fires.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top