0

It is my understanding that an Outlook contact's "avatar" image is stored as an Attachment object in the Attachments collection (ref).

Now suppose, as an example, that I want to keep my own (separate) contact database updated whenever the user's Outlook contacts change, so I'm registered for a PropertyChange event on the ContactItem. Is there any way to determine whether or not the picture attached to a ContactItem has changed, or do I need to call SaveAsFile() on the ContactPicture.jpg Attachment every time that I get a change notification, just on the off chance that it may have been updated?

Community
  • 1
  • 1
danBhentschel
  • 863
  • 7
  • 24

1 Answers1

1

There is no any kind of CRC of the attachment data, so you won't know if the actual binary data has changed. You can read the Attachment.Size property, and if it is different from what you had before, the data has changed for sure.

You can also read the PR_CREATION_TIME and PR_LAST_MODIFICATION_TIME properties using Attachment.PropertyAccessor.GetProperty, but these properties are not requires and can stay the same even if the data has changed.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • Thanks. This is helpful. I will probably end up using a combination of those three fields as a first-order indication of whether or not an item has changed, and then (depending on how well that seems to work) I may add some code to kick off a background process to retrieve and check the binary data. – danBhentschel Jan 15 '16 at 13:36