Share via

getSelectedItemsAsync returning empty array

Zahmedli 120 Reputation points
2026-04-08T07:00:22.12+00:00

Our new bulk-processing add-in is failing for users who prefer the "Reading Pane: Off" layout in Outlook. Even though SupportsMultiSelect is enabled in our manifest, calling Office.context.mailbox.getSelectedItemsAsync returns an empty array whenever the user selects multiple emails from the list view without the preview pane active. It works perfectly in "Right" or "Bottom" views, which feels like a major API inconsistency in the latest 2026 Monthly Enterprise Channel.

Here's the Xml:

<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">

<Hosts>

<Host xsi:type="MailHost">

  <DesktopFormFactor>

    <ExtensionPoint xsi:type="MessageReadCommandSurface">

      <OfficeTab id="TabDefault">

        <Group id="GroupBulkActions">

          <Label resid="groupLabel" />

          <Control xsi:type="Button" id="BulkProcessButton">

            <Label resid="buttonLabel" />

            <Suites>

              <SupportsMultiSelect>true</SupportsMultiSelect>

            </Suites>

            <Action xsi:type="ExecuteFunction">

              <FunctionName>processEmails</FunctionName>

            </Action>

          </Control>

        </Group>

      </OfficeTab>

    </ExtensionPoint>

  </DesktopFormFactor>

</Host>

</Hosts>

</VersionOverrides>

Outlook | Windows | Classic Outlook for Windows | For business
0 comments No comments

Answer accepted by question author
  1. Jayden-P 18,650 Reputation points Microsoft External Staff Moderator
    2026-04-08T07:58:56.3566667+00:00

    Hi @Zahmedli

    I found an aticle that might help: Activate your Outlook add-in without the Reading Pane enabled or a message selected - Office Add-in…

    To activate your add-in with the Reading Pane turned off or without a message selected, you must add the SupportsNoItemContext child element to the <Action> element and set its value to true. As this feature can only be implemented with a task pane in Message Read mode, the following elements must also be configured.

    • The VersionOverrides 1.1 Mail schema must be specified.
    • The xsi:type attribute value of the <ExtensionPoint> element must be set to MessageReadCommandSurface. (You had this in your xml file already)
    • The xsi:type attribute value of the <Action> element must be set to ShowTaskpane. (You need to add this)
    <Action xsi:type="ShowTaskpane">
           <SourceLocation resid="Taskpane.Url"/>
    		<!-- Enables your add-in to activate without the Reading Pane enabled or a message selected. -->
           <SupportsNoItemContext>true</SupportsNoItemContext>
       </Action>
    

    Please note that although Outlook on the web and new Outlook on Windows support requirement set 1.13, an add-in won't activate if the Reading Pane is hidden or a message isn't selected.

    I hope this information helps.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.