Can we use PrimaryCommandSurface in Outlook add-in generated by yo office

838 Views Asked by At

Is there any way we can use PrimaryCommandSurface to show the add-in on the top Ribbon in the outlook add-in development, if yes Please help with the updated valid manifest.xml.

If not help with the other way how to create outlook top Ribbon commands plug-in

<ExtensionPoint xsi:type="PrimaryCommandSurface">
          <CustomTab id="Contoso Tab">
          <!-- If you want to use a default tab that comes with Office, remove the above CustomTab element, and then uncomment the following OfficeTab element -->
            <!-- <OfficeTab id="TabData"> -->
            <Label resid="residLabel4" />
            <Group id="Group1Id12">
              <Label resid="residLabel4" />
              <Icon>
                <bt:Image size="16" resid="icon1_32x32" />
                <bt:Image size="32" resid="icon1_32x32" />
                <bt:Image size="80" resid="icon1_32x32" />
              </Icon>
              <Tooltip resid="residToolTip" />
              <Control xsi:type="Button" id="Button1Id1">

                  <!-- information about the control -->
              </Control>
              <!-- other controls, as needed -->
            </Group>
          </CustomTab>
        </ExtensionPoint>

      <ExtensionPoint xsi:type="ContextMenu">
        <OfficeMenu id="ContextMenuCell">
          <Control xsi:type="Menu" id="ContextMenu2">
                  <!-- information about the control -->
          </Control>
          <!-- other controls, as needed -->
        </OfficeMenu>
        </ExtensionPoint>
1

There are 1 best solutions below

4
Eugene Astafiev On

The PrimaryCommandSurface stands for the ribbon in Office. In case of Outlook we deal with read or compose items, so we should use the MessageReadCommandSurface for received items, for example:

<ExtensionPoint xsi:type="MessageReadCommandSurface">
  <OfficeTab id="TabDefault">
        <-- OfficeTab Definition -->
  </OfficeTab>
</ExtensionPoint>

The TabDefault is the idMso value of the built-in tab in Outlook.

Also you you can place controls into a custom tab in the following way:

<ExtensionPoint xsi:type="MessageReadCommandSurface">
  <CustomTab id="TabCustom1">
        <-- CustomTab Definition -->
  </CustomTab>
</ExtensionPoint>

If you need to get a ribbon UI displayed for the composed items in Outlook you need to use the MessageComposeCommandSurface extension point that puts buttons on the ribbon for add-ins using mail compose form:

<ExtensionPoint xsi:type="MessageComposeCommandSurface">
  <OfficeTab id="TabDefault">
        <-- OfficeTab Definition -->
  </OfficeTab>
</ExtensionPoint>

And to place controls into the custom tab:

<ExtensionPoint xsi:type="MessageComposeCommandSurface">
  <CustomTab id="TabCustom1">
        <-- CustomTab Definition -->
  </CustomTab>
</ExtensionPoint>

See the ExtensionPoint element for more information.