Up to now, the following line worked.

var comObject = Activator.CreateInstance(
     Type.GetTypeFromProgID("Outlook.Application"))

Since "the new Outlook" is turned on, that line does not return and just waits for something and hangs arround forever. Any ideas?

2

There are 2 best solutions below

0
Dmitry Streblechenko On

The new Outlook (Monarch) is an app completely different from the classic desktop Outlook and does not expose any API besides Web (JS) addins. There is nothing like the Outlook Object Model.

Keep in mind that Monarch (at least in its current version) is a replacement for Windows Mail and Windows Calendar, not desktop Outlook, which is still fully supported.

0
Eugene Astafiev On

Since "the new Outlook" is turned on, that line does not return and just waits for something and hangs arround forever. Any ideas?

That line doesn't make any sense in case of PWA.

The new Outlook doesn't provide any COM interfaces/objects to deal with, it is just a classic progressive web application (a web application wrapped in a native shell). It is not possible to automate it rather than running it with command line commands.

Instead, you may consider using the Graph API or EWS to deal with an account configured in the new Outlook and do the required actions that can be reflected in the email client application.