Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

[Exchange-Online][EWS][C#][Windows]: How do I mark all mails in a folder as read?

$
0
0

Hi,

I'm developing a C# application in Visual Studio 2013 Pro Update 2 to query an Exchange Online mailbox folder and read mails into my CRM solution. I can connect without a problem, read mails without a problem, mark individual emails as read without a problem, etc. but I don't seem to be able to mark all emails in a specific folder as being un/read.

I can see that in Exchange 2013 that the following code would do the trick, but it doesn't work for Exchange Online:-

Folder folder = Folder.Bind(service,folderID);
            folder.MarkAllItemsAsRead(true);

To mark an individual mail as being read I'm using this code:-

      public void MarkAsRead(ExchangeService exchangeService, ItemId itemID)
      {
         Item mess = Item.Bind(exchangeService, itemID);
         EmailMessage message = mess as EmailMessage;
         message.IsRead = true;
         message.Update(ConflictResolutionMode.AlwaysOverwrite);
      }
Does anyone know if Exchange Online has a method to mark all mails as read and if so, how do I call it?

Thanks,

Mike


Viewing all articles
Browse latest Browse all 7132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>