How to programmatically get a contact's picture in Outlook 2010?

[亡魂溺海] 提交于 2019-12-22 04:13:19

问题


How can you get a contact's picture from Outlook and save it to a file?

Thanks!


回答1:


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);


来源:https://stackoverflow.com/questions/4920168/how-to-programmatically-get-a-contacts-picture-in-outlook-2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!