【发布时间】:2020-09-28 04:28:36
【问题描述】:
outlook.MAPIFolder selectedFolder = m_applicationObject.ActiveExplorer().CurrentFolder;
string expMessage = "Your current folder is " + selectedFolder.Name + ".\n";
string itemMessage = "Item is unknown.";
try
{
if (m_applicationObject.ActiveExplorer().Selection.Count > 0)
{
Object selObject = m_applicationObject.ActiveExplorer().Selection[1];
if (selObject is outlook.MailItem)
{
outlook.MailItem mailItem = (selObject as outlook.MailItem);
itemMessage = " The subject is " + mailItem.Subject + ". \n";
itemMessage += " The Email is " + getSenderEmailAddress(mailItem) + ".\n";
itemMessage += " The name is " + mailItem.SenderName + ".\n";
itemMessage += " The Desc is " + mailItem.Body + ".\n";
//body consist of too many emails and its replies. is there any way i can extract latest email content from mailitem.Body
// mailItem.Display(false);
}
}
}
在上面的代码中,我从 Outlook 插件中提取电子邮件详细信息
正文包含过多的电子邮件及其回复。有什么办法可以从mailitem.Body提取最新的电子邮件内容
【问题讨论】:
标签: c# outlook outlook-addin office-interop