How to programmatically get a contact's picture in Outlook 2010?
How can you get a contact's picture from Outlook and save开发者_如何学JAVA it to a file?
Thanks!
The other answers here are good, but there's also an alternative:
Attachment.GetTemporaryFilePath Method (Outlook)
Attachment.SaveAsFile Method (Outlook)
To retrieve the path.
var attachment = contact.Attachments["ContactPicture.jpg"] as Attachment;
var path = attachment.GetTemporaryFilePath();
To save the file.
var attachment = contact.Attachments["ContactPicture.jpg"] as Attachment;
var path = attachment.SaveAsFile(savePath);
精彩评论