Adding a Outlook custom property causes sync issue

G

gqnelson

I am building an Outlook addin that adds a custom property (via
email.UserProperties) to an email item. I am running Outllook 2003 in Cached
Exchange Mode.

Frequently the emails I add the property to contain the message "You made
changes to another copy of this item. This is the most recent version. Click
here to see the other versions."

Is this an expected outcome? Is there a way to prevent these conflicts?
 
K

Ken Slovak - [MVP - Outlook]

That usually occurs if you are retaining any additional references to the
item being modified or if some other program is holding those references.
Are you doing that, or are you running any other code in Outlook like a COM
addin?

Does the same thing happen if you disable cached mode?
 
G

gqnelson

I am creating an AdvancedSearch. On the AdvancedSearchComplete event I add
ItemAdd, ItemChange and ItemRemove event listeners. I add a custom property
in the event handling of the Item... events. I do not hold onto any reference
after the event.

If I turn off Cached Exchange Mode everything works great.

Why would adding a property cause this sync conflict only in cached exchange
mode? Is there a way to work around it?
 
K

Ken Slovak - [MVP - Outlook]

Why would you add the event handlers in the search complete event?

You really should not be adding properties to an item in ItemChange or
ItemRemove. ItemRemove fires after the item has been moved/deleted and
ItemChange will continually fire if you don't use interlocking semaphores or
flags.

What exactly are you trying to accomplish and to what folders are you adding
the event handlers?
 
G

gqnelson

Our product needs to track information about certain attachments to email.

I create and AdvancedSearch to give me a Collection of all emails with
attachments. In another thread I process this collection. I use store custom
properties to help me determine emails I have already processed or emails
that have been moved.

I add listeners to the Collection so I can know when items have been added,
changed, removed. The removed event is not very useful since it does not tell
me what was removed. I use the custom properties to know if I have already
processed item so I don't continually get ItemChange event.

This is all working very well for me except, in cached exchanged mode. It
does not happen right away. But, if I move an item around to folder a few
times eventually I run into the Sync Issue.

Does this help you understand what I am doing? What causes the sync issue?
 
K

Ken Slovak - [MVP - Outlook]

There are a number of synching issues with cached mode, plus if your users
change the items using OWA they might lose the user properties anyway. I'd
suggest that if you only need 1 or 2 properties that you use an unused
standard property such as Mileage or Billing. Those are both string
properties and can hold whatever you want.
 

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