outlookoffice-jsoutlook-addinoffice-addinsoutlook-web-addins

Is there a way in outlook when creating a custom add in for the add in to always be visible in the side panel when activated


Ive been trying to create my own custom addin but when switching between emails from the list the add in disappears and has to be opened again.

From the docs ive found two settings in the manifest xml one being message for the extension point being messageReadCommandSurface the other messageComposeCommandSurface which allow the addin to appear but i want it present when reading emails however when opened and another email is clicked the add in is closed. Is there anyway around this so that it is always visible once opened until the user decides to close it?

https://learn.microsoft.com/en-us/javascript/api/manifest/extensionpoint?view=common-js-preview#primarycommandsurface


Solution

  • The best what you can do is to implement a pinnable task pane, so users could pin it and the task pane will stay visible when switching between email and your code can handle item switches programmatically.

    By default, if a user has an add-in task pane open for a message in the Reading Pane, and then selects a new message, the task pane is automatically closed. For a heavily-used add-in, the user may prefer to keep that pane open, eliminating the need to reactivate the add-in on each message. With pinnable task panes, your add-in can give the user that option.

    The first step is to add pinning support, which is done in the add-in manifest. Add the SupportsPinning element to the element that describes the task pane button. For example:

    <!-- Task pane button -->
    <Control xsi:type="Button" id="msgReadOpenPaneButton">
      <Label resid="paneReadButtonLabel" />
      <Supertip>
        <Title resid="paneReadSuperTipTitle" />
        <Description resid="paneReadSuperTipDescription" />
      </Supertip>
      <Icon>
        <bt:Image size="16" resid="green-icon-16" />
        <bt:Image size="32" resid="green-icon-32" />
        <bt:Image size="80" resid="green-icon-80" />
      </Icon>
      <Action xsi:type="ShowTaskpane">
        <SourceLocation resid="readTaskPaneUrl" />
        <SupportsPinning>true</SupportsPinning>
      </Action>
    </Control>
    

    The <SupportsPinning> element is defined in the VersionOverrides v1.1 schema, so you will need to include a VersionOverrides element both for v1.0 and v1.1. For a full example, see the msgReadOpenPaneButton control in the command-demo sample manifest.

    See Implement a pinnable task pane in Outlook for more information.