문제

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)

다른 팁

Use: string PR_CLIENT_READ = "http://schemas.microsoft.com/mapi/proptag/0x0E070003"; omMailItem.PropertyAccessor.SetProperty(PR_CLIENT_READ, 0x09);

Worked for me..

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top