0

I am working on an outlook add-in and I need the ability to open a task pane from one of the button commands.

Long story short the command will reach out to an API. The result of the API call will let the client side know if any user interaction is required. If it is I want to present the user with the task pane to fill in any required information.

From what I have found you should be able to call Office.addin.showAsTaskpane().

However this only works if you are using the Shared runtime requirement set which is only supported in Powerpoint, Word, and Excel.

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

2 Answers2

1

In Outlook you can open a task pane by clicking on the ribbon button or notification item which can be added programmatically, i.e. dynamically. So, you may consider adding a notification item with a link for opening a task pane as a possible workaround. However, it requires a user interaction.

Web add-ins don't provide any way in Outlook to open a task pane programmatically. You can file a new feature request at https://aka.ms/M365dev-suggestions .

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • Thanks for the advice, I tried adding an informatative notification and it threw the same error as when I tried calling show as task pane. Apparently the show task pane method is undefined. – Richard Eagle Apr 23 '22 at 01:52
  • I can confirm that a notification item with a link for opening a task pane works like a charm. I'd suggest checking the requirement set and post a separate question around that. – Eugene Astafiev Apr 23 '22 at 07:23
  • I am having a rough time. I cannot even get the Insight message to display. const message: Office.NotificationMessageDetails = { type: Office.MailboxEnums.ItemNotificationMessageType.InsightMessage, message: "InsightMessage", icon: "Icon.80x80", key: "action", actions: [ { actionType: Office.MailboxEnums.ActionType.ShowTaskPane, actionText: "Open", commandId: "msgReadOpenPaneButton" } ] }; Office.context.mailbox.item.notificationMessages.replaceAsync("action", message); – Richard Eagle Apr 25 '22 at 14:59
  • You have some syntax errors in your code. Namely you are passing in "message" but I don't think it is defined? (you also have a key:"action" in your JSON, that I don't think does anything). You can also change replaceAsync to addAsync...but I believe either should work. – Outlook Add-ins Team - MSFT Apr 28 '22 at 18:47
  • Try (but replace the values with correct values from your manifest): var message = { type: Microsoft.Office.WebExtension.MailboxEnums.ItemNotificationMessageType.InsightMessage, message: "InsightMessage", icon: "icon1", actions: [ { actionType: Microsoft.Office.WebExtension.MailboxEnums.ActionType.ShowTaskPane, actionText: "Open", commandId: "msgReadOpenPaneButton" } ] }; Office.context.mailbox.item.notificationMessages.addAsync("asdf", message, function (asyncResult) { console.log(JSON.stringify(asyncResult)); }); – Outlook Add-ins Team - MSFT Apr 28 '22 at 18:47
0

This is not supported yet

You can refer from here Duplicate question OR similar

Thanks