0
votes

I'm trying to implement a ribbon that displays the senders email in a task pane when the user reads an email and clicks on the ribbon button, but I cannot get this to work. I used this tutorial: https://docs.microsoft.com/en-us/visualstudio/vsto/walkthrough-displaying-custom-task-panes-with-e-mail-messages-in-outlook?view=vs-2019, but the ribbon doesn't show. When i change the ribbon type to Microsoft.Outlook.Explorer the ribbon shows, but if i click the button an error is thrown: enter image description here

I'm using inspectors to toogle the window, and according to Microsoft: "When you create a custom task pane for Outlook, the custom task pane is associated with a specific Explorer or Inspector window. Explorers are windows that display the contents of a folder, and Inspectors are windows that display an item such as an email message or a task." (https://docs.microsoft.com/en-us/visualstudio/vsto/custom-task-panes?view=vs-2019). So an inspector should have the email, right?

PS: I'm using Ribbon designer

2

2 Answers

0
votes

If you set the ribbon type property to the Microsoft.Outlook.Explorer value, you need to cast the context instance to the Outlook.Explorer class.

Most probably you are interested in creating a form region in Outlook, see Walkthrough: Design an Outlook form region for more information.

0
votes

Well, I found a solution. If you pop-out the email in a new window, the ribbon appears.