none
Outlook add-in command does not combine well with Activation Rules RRS feed

  • Question

  • Hi

    I'm developing an Outlook app, which has to support both ribbon command and contextual activation. I'm getting a problem with the activation rule collection: when I use nested activation rule collections, the ribbon command group disappear. This is my activation rule:

      <Rule xsi:type="RuleCollection" Mode="Or">
        <Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Edit" />
        <Rule xsi:type="RuleCollection" Mode="And">
          <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="ReplyLinkRegex" RegExValue="ReplyLink=.*_endLink" PropertyName="BodyAsHTML" />
          <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />      
        </Rule>
      </Rule>

    If I remove the nested collection and change the rule like this, the ribbon group will be shown again:

      <Rule xsi:type="RuleCollection" Mode="Or">
        <Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Edit" />
        <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="ReplyLinkRegex" RegExValue="ReplyLink=.*_endLink" PropertyName="BodyAsHTML" />
      </Rule>

    I just want to keep using the nested rule for better contextual filter and also have my ribbon commands displayed. Please help me if you have any idea.

    Thank you.

    Friday, January 8, 2016 8:47 AM

All replies

  • Hi Ben,

    Thanks for posting in MSDN forum.

    As far as I know, the rule of add-in command for Outlook is a little different with normal add-in. ItemType is either "Message" or "AppointmentAttendee" and there is and there is no FormType attribute. For more information, see Custom pane Outlook add-ins and Activation rules for Outlook add-ins.

    And here is also an helpful article for your reference:
    Define add-in commands in your Outlook add-in manifest

    If you want it support other kind of rule, you can try to submit the feedback via link below:
    Customer Feedback for the Office Developer Platform

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, January 11, 2016 7:17 AM
    Moderator
  • Hi Fei Xue,

    Thank you for helping me.

    I think we're having misunderstanding here, maybe because I described the issue unclearly. Let me correct it.

    First of all, I know that the rule for Command is different with normal add-in. The rule collection I posted above is for OWA and non-command add-in. I also have a custom pane command in my add-in and the rule for it is different from this one. I've read all MSDN topic about add-in command and find nothing :(

    The issue I'm facing is: The rule for normal add-in somehow affects the command in the "VersionOverrides" section. The command group is not shown if I use the nested rule in the normal section.

    This is my manifest, please take a look to see if you find any problem.

    Thank you!

    <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>3e3bdbcd-5f07-4b8d-b22a-074e951e4e90</Id>
      <Version>1.2.0</Version>
      <ProviderName>MyCompany</ProviderName>
      <DefaultLocale>en-US</DefaultLocale>
      <DisplayName DefaultValue="MyApp" />
      <Description DefaultValue="Description" />
      <IconUrl DefaultValue="https://MyServer/logo_80x80.png" />
      <HighResolutionIconUrl DefaultValue="https://MyServer/logo_128x128.png" />
      <SupportUrl DefaultValue="http://MyServer" />
      <AppDomains>
        <AppDomain>https://MyServer</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://MyServer" />
            <RequestedHeight>450</RequestedHeight>
          </DesktopSettings>
        </Form>
        <Form xsi:type="ItemEdit">
          <DesktopSettings>
            <SourceLocation DefaultValue="https://MyServer" />
          </DesktopSettings>
        </Form>
      </FormSettings>
      <Permissions>ReadWriteItem</Permissions>
      
      <!--BEGIN rules for OWA and normal add-in-->
      <Rule xsi:type="RuleCollection" Mode="Or">
        <Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Edit" />
        <Rule xsi:type="RuleCollection" Mode="And">
          <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="ReplyLinkRegex" RegExValue="ReplyLink=.*_endLink" PropertyName="BodyAsHTML" />
          <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
        </Rule>
      </Rule>
      <!--END rules for OWA and normal add-in-->
      
     <!-- BEGIN add-in command defination-->
      <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
        <Description resid="residDescription" />
        <Requirements>
          <bt:Sets DefaultMinVersion="1.3">
            <bt:Set Name="MailBox"/>
          </bt:Sets>
        </Requirements>
        <Hosts>
          <Host xsi:type="MailHost">
            <DesktopFormFactor>
              <FunctionFile resid="functionFile" />
              <ExtensionPoint xsi:type="AppointmentOrganizerCommandSurface">
                <OfficeTab id="TabDefault">
                  <Group id="apptComposeGroup">
                    <Label resid="lblGroupLabel"/>
                    <Tooltip resid="lblToolTip" />
                    <Control xsi:type="Button" id="apptComposeBtn">
                      <Label resid="apptComposeBtnLbl"/>
                      <Tooltip resid="apptComposeBtnToolTip"/>
                      <Supertip>
                        <Title resid="apptComposeSuperTip"/>
                        <Description resid="apptComposeDesc"/>
                      </Supertip>
                      <Icon>
                        <bt:Image size="16" resid="rc-ico-16"/>
                        <bt:Image size="32" resid="rc-ico-32"/>
                        <bt:Image size="80" resid="rc-ico-80"/>
                      </Icon>
                      <Action xsi:type="ShowTaskpane">
                        <SourceLocation resid="apptComposeUrl"/>
                      </Action>
                    </Control>
                  </Group>
                </OfficeTab>
              </ExtensionPoint>
              <ExtensionPoint xsi:type="CustomPane">
                <RequestedHeight>450</RequestedHeight>
                <SourceLocation resid="customPaneUrl"/>
                <Rule xsi:type="RuleCollection" Mode="And">
                  <Rule xsi:type="ItemIs" ItemType="Message" />
                  <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="ReplyLinkRegex" RegExValue="ReplyLink=.*_endLink" PropertyName="BodyAsHTML" />
                </Rule>
              </ExtensionPoint>
            </DesktopFormFactor>
          </Host>
        </Hosts>
        <Resources>
          <bt:Images>
            <bt:Image id="rc-ico-16" DefaultValue="https://MyServer/images/OfficeApp/16x16.png"/>
            <bt:Image id="rc-ico-32" DefaultValue="https://MyServer/images/OfficeApp/32x32.png"/>
            <bt:Image id="rc-ico-80" DefaultValue="https://MyServer/images/OfficeApp/80x80.png"/>
          </bt:Images>
          <bt:ShortStrings>
            <bt:String id="lblGroupLabel" DefaultValue="Some Strings"/>
            <bt:String id="apptComposeBtnLbl" DefaultValue="Some Strings"/>
            <bt:String id="apptComposeSuperTip" DefaultValue="Some Strings"/>
          </bt:ShortStrings>
          <bt:LongStrings>
            <bt:String id="lblToolTip" DefaultValue="Some Strings"/>
            <bt:String id="apptComposeBtnToolTip" DefaultValue="Some Strings"/>
            <bt:String id="apptComposeDesc" DefaultValue="Some Strings"/>
            <bt:String id="residDescription" DefaultValue="Some Strings" />
          </bt:LongStrings>
          <bt:Urls>
            <bt:Url id="functionFile" DefaultValue="https://MyServer/functions.html" />
            <bt:Url id="apptComposeUrl" DefaultValue ="https://MyServer"/>
            <bt:Url id="customPaneUrl" DefaultValue ="https://MyServer"/>
          </bt:Urls>
        </Resources>
      </VersionOverrides>
    <!--END add-in command defination-->
    </OfficeApp>

    Monday, January 11, 2016 7:56 AM
  • Hi Ben,

    Thanks for the detail explanation.

    >>The issue I'm facing is: The rule for normal add-in somehow affects the command in the "VersionOverrides" section. The command group is not shown if I use the nested rule in the normal section<<

    I could also reproduce this issue too. To fix this issue, I suggest that you try to contact the Office Developer Team from link below:
    Customer Feedback for the Office Developer Platform

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, January 12, 2016 6:58 AM
    Moderator
  • Hi Fei,

    Thanks for reproducing my issue.

    I'll contact the Dev. Team to see if they can help.

    Tuesday, January 12, 2016 10:03 AM