Search code examples
c#add-inpreviewmailitem

C# Outlook Addin - Show Outlook.mailitem in the outlook preview pane?


I am currently making an Add-In for Microsoft Outlook.

Situation:

  • I get a Internet Message ID (IMID) from a database
  • I get the Entry ID of the Mail by searching for the IMID
  • I get the Outlook.MailItem with the EntryID
  • Right now, I open the mail in a new window (inspector) with the Display() Method, but I dont want a new window to pop up every time

Now I have the MailItem and want to preview it in the Outlook-Preview panel. Anyone knows a way to do that?

Thanks, Florian


Solution

  • With my forgotten knowledge an this post, here is the solution:

    Deselect all items in the current explorer with Explorer.ClearSelection() and select the item with Explorer.AddtoSelection() to display the item in the preview pane.