When attachment is Email I could simply get the mime content and save it. But when the attachment is Contact I am not able to get the MimeContent. Here is the code
itemAttachment.Load(new PropertySet(ItemSchema.MimeContent));
MimeContent mc = itemAttachment.Item.MimeContent;
//Convert it to bytes
byte[] contentBytes = mc.Content;
When attachment is contact I am getting below exception
Microsoft.Exchange.WebServices.Data.ServiceResponseException occurred HResult=-2146233088 Message=MIME conversion is not supported for this item type. Source=Microsoft.Exchange.WebServices StackTrace: at Microsoft.Exchange.WebServices.Data.ServiceResponse.InternalThrowIfNecessary() at Microsoft.Exchange.WebServices.Data.ServiceResponse.ThrowIfNecessary() at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest
1.Execute() at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalGetAttachments(IEnumerable
1 attachments, Nullable1 bodyType, IEnumerable
1 additionalProperties, ServiceErrorHandling errorHandling) at Microsoft.Exchange.WebServices.Data.ExchangeService.GetAttachment(Attachment attachment, Nullable1 bodyType, IEnumerable
1 additionalProperties) at Microsoft.Exchange.WebServices.Data.Attachment.InternalLoad(Nullable1 bodyType, IEnumerable
1 additionalProperties) at Microsoft.Exchange.WebServices.Data.ItemAttachment.Load(IEnumerable`1 additionalProperties) at Presensoft.JournalEmailVerification.EmailVerification.DownloadFailedAttachments(EmailMessage msg, JournalEmail journalEmail) in C:\Users\sameer\Presensoft\Email Archiving\Presensoft.JournalEmailVerification\EmailVerification.cs:line 605 InnerException:
What is the proper way to download and save Contact attachment?