Is it possible to use Microsoft Outlook Interop in a Blazor WebAssembly application?

displayname545345 20 Reputation points
2023-06-22T19:19:38.8033333+00:00

Hi. I tried using Microsoft.Office.Interop.Outlook in my blazor webassembly application but I'm running into the following issues:

  1. When the following line executes, it just stops here. No exception is thrown and the breakpoints do not continue. outlookIO.Application app = new outlookIO.Application();
  2. When I changed the line to this, an exception is thrown that says the "COM Interop is not available on this platform" outlookIO.Application app = (outlookIO.Application) Marshal.BindToMoniker("Outlook.Application");

What I'm trying to do is allow the user to drag an email from their Outlook desktop application and drop it into the blazor app so it can get all the attachments as well as get the name of the sender.

Developer technologies | .NET | Blazor
Outlook | Windows | Classic Outlook for Windows | For business
Developer technologies | C#
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 78,006 Reputation points Volunteer Moderator
    2023-06-22T19:56:22.9333333+00:00

    no, it is not supported. Blazor WASM run in a sandbox, and com+ is not supported. actually the sandbox allows no network, file, dom or O/S access.

    if using office 365, you can use the the graphapi to list the inbox entries and build the drag and drop feature. as Blazor WASM can not access the file system, not sure what you wanted to do with the attachments.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.