C# Outlook interop and OpenSharedItem for opening MSG files

笑着哭i 提交于 2019-12-20 17:17:21

问题


Is there any tutorial or resource I can follow in order to use the OpenSharedItem outlook interop method. My goal is to read MSG files using it (as it can apparently do so).


回答1:


How to: Create a Contact Item from a vCard file and Save the Item in a Folder

How to: Import Saved Items using OpenSharedItem




回答2:


Thanks Svetlozar, I've used the resources to create something like the following:

Microsoft.Office.Interop.Outlook.Application app = new Microsoft.Office.Interop.Outlook.Application();

var item = app.Session.OpenSharedItem("C:\\test.msg") as Microsoft.Office.Interop.Outlook.MailItem;
string body = item.HTMLBody;
int att = item.Attachments.Count;

It may be useful to others looking for a quickstart as I was.



来源:https://stackoverflow.com/questions/1907045/c-sharp-outlook-interop-and-openshareditem-for-opening-msg-files

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