Event on “Item Sent” in Outlook

◇◆丶佛笑我妖孽 提交于 2019-12-01 04:10:39

If you use a modal dialog (WPF/Winforms MessageBox), you will only get the first event trigger. You must implement a non-blocking event handler (possibly an item queuing strategy).

Don't use the blocking UI call modal dialogs - Outlook will notice the UI is blocked and ignore triggering subsequent interrupts.

See this form post for reference.


If you are worried about the users preferences for controlling Sent Item storage, just override them using the following snippet...

MailItem.DeleteAfterSubmit = false; // force storage to sent items folder (ignore user options)
Outlook.Folder sentFolder = ThisAddIn.Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderSentMail);
if (sentFolder != null)
    MailItem.SaveSentMessageFolder = sentFolder; // override the default sent items location
MailItem.Save(); 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!