例如,我有给定的字符串john@doe.com我必须在C#VSTO项目中使用发件人设置器将其设置为邮件项目中的传出邮箱。
这是我的实际代码(我让完整的限定名表示我对MailItem的意思):
Microsoft.Office.Interop.Outlook.MailItem mailItem = (Microsoft.Office.Interop.Outlook.MailItem) Globals.ThisAddIn.Application.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
mailItem.Subject = "Order #1";
mailItem.To = "orderbot@doe.com";
mailItem.Sender = (Here has to be the EntryAddress)
mailItem.Display(false);