Pergunta

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.

Foi útil?

Solução

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)

Outras dicas

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

Worked for me..

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top