How to determine whether or not user sent MS Outlook message which was built from Java code?

前端 未结 1 1205
囚心锁ツ
囚心锁ツ 2021-01-27 05:08

In my program I create Outlook.exe process and send message with pre-populated contain. After sending message or closing message window I need to know whether or not user sent m

相关标签:
1条回答
  • 2021-01-27 05:59

    Firstly, Outlook is a singleton - if outlook.exe is already running, launching the second instance will simply transfer control to the first instance. Secondly, you are hardcoding the outlook.exe file location.

    Use the Outlook Object Model (use a COM bridge) - create an instance of the Outlook.Application COM object, create new message using Application.CreateItem(0), populate the message properties (subject, Body, Recipients, etc,.) and either call MailItem.Send or display the message using MailItem.Display and trap the MailItem.Send event.

    0 讨论(0)
提交回复
热议问题