简体   繁体   English

如何在组合状态下打开Outlook邮件项?

[英]How to open a Outlook mail item in a composing state?

How to open a MailItem using Outlook Interop dll. 如何使用Outlook Interop dll打开MailItem

This is the code I am using: 这是我正在使用的代码:

Microsoft.Office.Interop.Outlook.Application app = new Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook._MailItem mailItm = (Microsoft.Office.Interop.Outlook._MailItem)app.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
mailItm.To = "xxx@xxx.com";
mailItm.CC = "yyy@yyy.com";
mailItm.Subject = "Some Subject";

mailItem.Send() is used to send a mail. mailItem.Send()用于发送邮件。 But I want to open a mail item in a composed state. 但我想打开一个组合状态的邮件项目。 How to do that? 怎么做?

You only have to Display the item: 您只需要Display项目:

mailItem.Display(false);

(the false here indicates that the Inspector shouldn't be modal) (这里的false表示Inspector不应该是模态的)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM