【发布时间】:2015-06-04 13:02:47
【问题描述】:
要从 .msg 文件传递到其相关的 Outlook MailItem,我找到并尝试了以下两种方法:
Outlook.Application oApp; // --> Outlook Application
Outlook.MailItem oItem; // --> Outlook MailItem
string file= @"C:\PWS\myMail.msg";
oApp= (Outlook.Application)new Outlook.Application();
// way #1
oItem= (Outlook.MailItem)oApp.CreateItemFromTemplate(file);
// or way #2
oItem= (Outlook.MailItem)oApp.Session.OpenSharedItem(file);
这两种方式有什么区别?我需要打开 .msg,然后使用生成的 MailItem(获取一些属性作为“SenderEmailAddress”或电子邮件附件)......我应该使用什么?目前它们对我来说是一样的......
【问题讨论】: