OfficeDev / ews-managed-api

Other
584 stars 316 forks source link

Contact picture not showing in business card but present inside contact details- C#, Outlook 2010, EWS Managed API #221

Closed jyothsnasarali closed 5 years ago

jyothsnasarali commented 5 years ago

Contact picture is programmatically loaded for each contact based on email. But for some contacts, the photo does not load in the Business card. It appears as only a box. The picture is present when double clicked on the card to view contact details. I convert the pictures for proper dimensions and then load them as a file attachment.

//buildPath method fetches the file path from the Contact images folder (folderPath + "\" + email + ".png"). Returns the new path depending on the email of user picPath = buildFilePath(email);

FileAttachment picAttach = newcontact.Attachments.AddFileAttachment(picPath); picAttach.IsContactPhoto = true; convertPic(personId, picPath); newcontact.Save();

jyothsnasarali commented 5 years ago

The picture had to be dimensioned to the business card attributes of width and height. When this dimension is met, the image loads in the business card as well.