3

Backgroundinfo:

  • I am currently working on a project which runs on UiPath and includes Outlook. I need the Windows Task Scheduler to schedule a Task once an E-Mail is coming in.

The Problem:

  • I understand in order to schedule a Task on an event an Event ID is needed - as far as I know there is no EventID for receiving E-Mails, but I heard that there is one for sending E-Mails.

The Workaround:

  • If an E-Mail is received, with Outlook-Rules I send an automatic response and upon sending there should be the "Sending E-Mail"-Event and with that I can Schedule a Task.

That's it for the theory but I can't find the EventID I need, does it even exist? Am I looking in the wring places?

I tried sending an E-Mail whilst checking with the "Event-Viewer" if any Event fires, but nothing happens. The only Outlook ID's I can find are:

  1. ID 32: The store C:\(...) has detected a catalog checkpoint.
  2. ID 45: Outlook loaded the following add-in(s): (...)
  3. ID 63: The Exchange web service request GetAppManifests succeeded.
Daniel Maurer
  • 156
  • 1
  • 15

1 Answers1

3

You will not meet such information in the Windows event viewer. Instead, I'd suggest developing a COM add-in for Outlook where you can handle the NewMailEx event of the Application class which is fired when a new item is received in the Inbox. See Walkthrough: Create your first VSTO Add-in for Outlook for more information.

The NewMailEx event fires when a new message arrives in the Inbox and before client rule processing occurs. You can use the Entry ID returned in the EntryIDCollection array to call the NameSpace.GetItemFromID method and process the item. Use this method with caution to minimize the impact on Outlook performance. However, depending on the setup on the client computer, after a new message arrives in the Inbox, processes like spam filtering and client rules that move the new message from the Inbox to another folder can occur asynchronously.

You can treat a VSTO add-in as a regular .Net application where you can do whatever you need.

Community
  • 1
  • 1
Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45