Import .msg file to outlook custom folder using c#

前端 未结 3 1600
孤街浪徒
孤街浪徒 2021-01-28 11:34

I need to add the .msg files to outlook custom folder using VSTO addin c#

3条回答
  •  梦如初夏
    2021-01-28 12:14

    You can open an existing Outlook message from a disk by using the CreateItemFromTemplate method of the Application class. The method creates a new Microsoft Outlook item from an Outlook template (.oft) and returns the new item. But you can pass an Outlook .msg file too. The How To: Create a new Outlook message based on a template article explains all the steps in details.

    Another way is to run the .msg file programmatically. The Process.Start method can be used for that, you just need to specify the file path. The message will be opened in the running Outlook instance due to the fact that Outlook is a singleton. So, you can handle the NewInspector event and get a handle to the message just opened.

提交回复
热议问题