我需要以编程方式从共享点打开 Outlook 撰写邮件,我尝试了此代码,但它只打开 Outlook 进程,但没有出现撰写邮件窗口
using (SPSite currentSite = new SPSite(SPContext.Current.Site.ID))
{
using (SPWeb currentWeb = currentSite.OpenWeb(SPContext.Current.Web.ID))
{
WebURL = currentWeb.Url;
currentWeb.AllowUnsafeUpdates = true;
SPList correspondences = currentWeb.Lists.TryGetList("list1");
SPListItem correspondenceItem = correspondences.GetItemById(id);
WebURL = currentWeb.Url;
SPAttachmentCollection CorrespondenceAttachemt = correspondenceItem.Attachments;
Microsoft.Office.Interop.Outlook.Application oApp = new Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook._MailItem oMailItem = (Microsoft.Office.Interop.Outlook._MailItem)oApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
oMailItem.Body = body;
oMailItem.Subject = title;
oMailItem.Display();
}
}