im trying to delete a FileAttachment within an attached Outlook-Mail-Item in a EmailMessage, but its saying the following error when updating the EmailMessage:
At least one attachment couldn't be deleted.
Heres the code im using:
// eMessageToWork is an attached EmailMessage
// Im saving the attachments from eMessageToWork to disk before i want to remove it from the attached email
Attachment att = eMessageToWork.Attachments[i];
// ... saving attachments to disk ...
// Now remove the attachment from the attached mail
eMessageToWork.Attachments.Remove(att);
// rootMailMessage is the root mail and contains as attachment eMessageToWork
// Here is the problem and the exception is thrown.
rootMailMessage.Update(ConflictResolutionMode.AlwaysOverwrite);
I had more strange errors to resolve since the version changed to 2016. I cant even do it manually by just opening outlook, because the context option "remove" when right-clicking the file-attachment is greyed out.
Is there a problem with my access rights? If yes, next question would be, why im not getting a proper exception message then? :D
Does anyone have clue on major security changes for exchange server 2016, that could be the source for this?