Item object returned by Items.ChangeItem event

L

Lily Collins

I am trying to perform a two way automatic synchronization between Outlook 2007 and MOSS 2007 i.e. when an item is added to the default calendar in Outlook it is automatically added to a connected MOSS calendar and vice versa when a send/receive takes place.

I have event handlers for add and change on the Items collection and BeforeItemMove to catch items moved to the delete items folder.

Going from Outlook works fine. Adding an item in SharePoint works fine (i.e. adding a new item in SharePoint, not in the SharePoint calendar displayed in Outlook). But if I make any changes to an appointment in SharePoint the ChangeItem event is fired but the Item object passed doesn't have the latest values i.e. it has previous values.

I have tried setting the item object to null after the event handler has run (so that the next time the event handler is called a new Item object will need to be generated) but that doesn't appear to make any difference. However, if I don't make any changes for about half an hour the item passed does hold the new values, so there appears to be some sort of caching.

If I hover over the item in the SharePoint calendar in Outlook the correct values are shown but the old values are shown in the inspector (i.e. changes made on the SharePoint server to the item don't get updated in the inspector but are available to Outlook when I hover over the item).

I don't really understand what's happening as Outlook clearly has the updated information otherwise it wouldn't display when I hover over the item. But I don't know why the correct values aren't in the Item object generated by the ChangeItem event. I would just like to understand what's happening so that I can code accordingly.
 

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