1
votes

Is it possible to add an Outlook Web Addin function to the context menu? As it was possible with the old VSTO Addins:

enter image description here

I only find some examples with tab ribbons, like:

      <!--PrimaryCommandSurface==Main Office Ribbon-->
      <ExtensionPoint xsi:type="PrimaryCommandSurface">
        <CustomTab id="Contoso.Tab1">
          <Group id="Contoso.Tab1.Group1">
            <Label resid="Contoso.Tab1.GroupLabel" />
            <Icon>
              <bt:Image size="16" resid="Contoso.TaskpaneButton.Icon" />
              <bt:Image size="32" resid="Contoso.TaskpaneButton.Icon" />
              <bt:Image size="80" resid="Contoso.TaskpaneButton.Icon" />
            </Icon>
            <!--Control. It can be of type "Button" or "Menu" -->
            <Control xsi:type="Button" id="Contoso.FunctionButton">
              <Label resid="Contoso.FunctionButton.Label" />
2
No, it is impossible to do that. - Dmitry Streblechenko
I work in Outlook add-in development and I had this requirement as well. However, the context menu in Outlook web add-in is not allowed to be extended. Microsoft hasn't provided the context menu as a extension point for web add-in. So this is not possible. However, it is possible in native windows add-in. - Balaji Birajdar

2 Answers

3
votes

Outlook Web Add-ins allow customizing the ribbon by adding commands only. Read more about that in the Add-in commands for Outlook article.

1
votes

From what I can tell this might be possible. You can find an example here for a different Office app, but I assume that it should hold true for Outlook as well. In Excel a context menu is added with adding the following code to the manifest. Please note that the code below does not include the references (resid's) to urls, long strings and short strings.

<!-- ContextMenu extends selected context menus (E.g. right click menu)--> 
      <ExtensionPoint xsi:type="ContextMenu">
        <!--The id of the menu specifies the existing context menu being extended-->
        <!--ContextMenuCell (Excel) and ContextMenuText (Word) are currently supported-->
      <OfficeMenu id="ContextMenuCell">
        <Control xsi:type="Menu" id="Contoso.TestMenu2">
          <Label resid="residLabel3" />
          <Supertip>
            <Title resid="residLabel" />
            <Description resid="residToolTip" />
          </Supertip>
          <Icon>
            <bt:Image size="16" resid="icon1_32x32" />
            <bt:Image size="32" resid="icon1_32x32" />
            <bt:Image size="80" resid="icon1_32x32" />
          </Icon>
          <Items>
            <Item id="showGallery2">
              <Label resid="residLabel3"/>
              <Supertip>
                <Title resid="residLabel" />
                <Description resid="residToolTip" />
              </Supertip>
              <Icon>
                <bt:Image size="16" resid="icon1_32x32" />
                <bt:Image size="32" resid="icon1_32x32" />
                <bt:Image size="80" resid="icon1_32x32" />
              </Icon>
              <Action xsi:type="ShowTaskpane">
                <!--TaskPaneId is required. It is currently not used by the framework but it will be in a future iteration -->
                <TaskpaneId>MyTaskPaneID1</TaskpaneId>
                <!--The URL to show inside the taskpane -->
                <SourceLocation resid="residUnitConverterUrl" />
              </Action>
            </Item>
          <Item id="showGallery3">
              <Label resid="residLabel5"/>
              <Supertip>
                <Title resid="residLabel" />
                <Description resid="residToolTip" />
              </Supertip>
              <Icon>
                <bt:Image size="16" resid="icon1_32x32" />
                <bt:Image size="32" resid="icon1_32x32" />
                <bt:Image size="80" resid="icon1_32x32" />
              </Icon>
              <Action xsi:type="ShowTaskpane">
                <TaskpaneId>MyTaskPaneID2</TaskpaneId>
                <SourceLocation resid="residUnitConverterUrl" />
              </Action>
            </Item>
          </Items>
        </Control>
      </OfficeMenu>
     </ExtensionPoint>