What's the proper way to set a MailItem as read before opening or set the value suppress_receipt in PR_MESSAGE_FLAGS?
Looking at http://msdn.microsoft.com/en-us/library/office/cc815395(v=office.12).aspx my code is:
MailItem x = item as MailItem;
x.PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/proptag/0x0E070003",35);
I got 35 from other read mails using OutlookSpy, assuming it contains the boolean flag for "Read".
Running this code gets me the exception "The operation failed". Any ideas? Thanks.
You cannot do that in the Outlook Object Model. On the MAPI level, you need to call IMessage::SetReadFlag(SUPPRESS_RECEIPT)
, but you will need C++ or Delphi for that.
If using Redemption (I am its author) is an option, you can use RDOMail.MarkRead(SuppressReceipt)
(can be called from any language)