Search code examples
outlookoffice-jsoutlook-addinoffice-addinsoutlook-web-addins

Outlook add-in not showing in shared mailbox


I am trying to see how add-ins work for the first time now, and according to the documentation it should be possible to view the add-in inside my shared mailbox. For some reason it doesn't seem to work, is this because I'm running the add-in locally?

I can say that I am able to support the latest version, so that's not a problem. So far, the only thing I did was create the outlook add-in tutorial and added the changes for the support mailbox, so nothing special is happening right now.

Any ideas what the problem might be?

Thanks in advance!

Billy Cottrell

UPDATE 1:

This outlook add-in is mainly built for Outlook app for Windows, which comes as part of the Office 365 package.

The Outlook version im using is a recent one: Version 2302 build 16130.20218

As I mentioned before, the code is nothing special and can be reproduced by following the outlook add-in tutorial using the yeoman generator: https://learn.microsoft.com/en-us/office/dev/add-ins/quickstarts/outlook-quickstart?tabs=yeomangenerator

The only change I have made is to the manifest, which is according to the documentation to allow the add-in to be used within a shared mailbox: https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/delegate-access?tabs=windows%2Cxmlmanifest#configure-the-manifest

So only the permission element was updated and the Supportsharedfolder was added and set to true.

Hope this information helps!

Manifest:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
  xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0"
  xsi:type="MailApp">
  <Id>01d67f6d-b061-4c40-9851-85106bdef930</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>Contoso</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="My Office Add-in" />
  <Description DefaultValue="A template to get started." />
  <IconUrl DefaultValue="https://localhost:3000/assets/icon-64.png" />
  <HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/icon-128.png" />
  <SupportUrl DefaultValue="https://www.contoso.com/help" />
  <AppDomains>
    <AppDomain>https://www.contoso.com</AppDomain>
  </AppDomains>
  <Hosts>
    <Host Name="Mailbox" />
  </Hosts>
  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.1" />
    </Sets>
  </Requirements>
  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://localhost:3000/taskpane.html" />
        <RequestedHeight>250</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>
  <Permissions>ReadWriteMailbox</Permissions>
  <Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
  </Rule>
  <DisableEntityHighlighting>false</DisableEntityHighlighting>
  <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides"
    xsi:type="VersionOverridesV1_0">
    <Requirements>
      <bt:Sets DefaultMinVersion="1.3">
        <bt:Set Name="Mailbox" />
      </bt:Sets>
    </Requirements>
    <Hosts>
      <Host xsi:type="MailHost">
        <DesktopFormFactor>
          <SupportsSharedFolders>true</SupportsSharedFolders>
          <FunctionFile resid="Commands.Url" />
          <ExtensionPoint xsi:type="MessageReadCommandSurface">
            <OfficeTab id="TabDefault">
              <Group id="msgReadGroup">
                <Label resid="GroupLabel" />
                <Control xsi:type="Button" id="msgReadOpenPaneButton">
                  <Label resid="TaskpaneButton.Label" />
                  <Supertip>
                    <Title resid="TaskpaneButton.Label" />
                    <Description resid="TaskpaneButton.Tooltip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.16x16" />
                    <bt:Image size="32" resid="Icon.32x32" />
                    <bt:Image size="80" resid="Icon.80x80" />
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <SourceLocation resid="Taskpane.Url" />
                  </Action>
                </Control>
                <Control xsi:type="Button" id="ActionButton">
                  <Label resid="ActionButton.Label" />
                  <Supertip>
                    <Title resid="ActionButton.Label" />
                    <Description resid="ActionButton.Tooltip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.16x16" />
                    <bt:Image size="32" resid="Icon.32x32" />
                    <bt:Image size="80" resid="Icon.80x80" />
                  </Icon>
                  <Action xsi:type="ExecuteFunction">
                    <FunctionName>action</FunctionName>
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>
    <Resources>
      <bt:Images>
        <bt:Image id="Icon.16x16" DefaultValue="https://localhost:3000/assets/icon-16.png" />
        <bt:Image id="Icon.32x32" DefaultValue="https://localhost:3000/assets/icon-32.png" />
        <bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/icon-80.png" />
      </bt:Images>
      <bt:Urls>
        <bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html" />
        <bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html" />
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="GroupLabel" DefaultValue="Contoso Add-in" />
        <bt:String id="TaskpaneButton.Label" DefaultValue="Show Taskpane" />
        <bt:String id="ActionButton.Label" DefaultValue="Perform an action" />
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="TaskpaneButton.Tooltip"
          DefaultValue="Opens a pane displaying all available properties." />
        <bt:String id="ActionButton.Tooltip" DefaultValue="Perform an action when clicked." />
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>

UPDATE 2:

Updating the requirement set to a more recent version 1.12 didn't work...


Solution

  • In the manifest file you need to set the SupportsSharedFolders element to true under the parent element DesktopFormFactor.

    ...
    <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
      <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
        ...
        <Hosts>
          <Host xsi:type="MailHost">
            <DesktopFormFactor>
              <SupportsSharedFolders>true</SupportsSharedFolders>
              <FunctionFile resid="residDesktopFuncUrl" />
              <ExtensionPoint xsi:type="MessageReadCommandSurface">
                <!-- configure selected extension point -->
              </ExtensionPoint>
    
              <!-- You can define more than one ExtensionPoint element as needed -->
    
            </DesktopFormFactor>
          </Host>
        </Hosts>
        ...
      </VersionOverrides>
    </VersionOverrides>
    ...
    

    You can get an item's shared properties in Compose or Read mode by calling the item.getSharedPropertiesAsync method. This returns a SharedProperties object that currently provides the user's permissions, the owner's email address, the REST API's base URL, and the target mailbox.

    See Enable shared folders and shared mailbox scenarios in an Outlook add-in for more information and versions of client applications that support this feature.

    Support for this feature was introduced in requirement set 1.8 (for details, refer to clients and platforms).