locked
Working example of add-in commands for Mail? RRS feed

  • Question

  • Add-in commands for Mail look like just what I need. I'm trying to prove-out the technology for a particular use, but the documentation is not detailed and doesn't seem complete yet. I've found no tutorial or code sample.

    So, for now I'm trying to follow the overview documentationmanifest documentation, and Build video (00:34:36) to create a ribbon button that opens a pane. I'm using the default project template for a read+compose Mail app (my working manifest). But the add-in stops loading as soon as I add the VersionOverrides section, and I have XML validation warnings. I'm using Office 2016. I made the home.html files use v1.1 Office.js.

    Does anyone have a working sample of an "add-in command for Mail" that they can share? Thanks.



    • Edited by JVimes3 Monday, August 10, 2015 9:02 PM
    Monday, August 10, 2015 8:15 PM

Answers

  • Hi JVimes3,

    >>But the add-in stops loading as soon as I add the VersionOverrides section, and I have XML validation warnings. <<

    Did you get any error message? I am trying to use the manifest you proved to reproduce the issue, however failed.

    Here is the manifest I tested for your reference:

    <?xml version="1.0" encoding="UTF-8"?>
    <!--Created:cb85b80c-f585-40ff-8bfc-12ff4d0e34a9-->
    <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>7ef0fb73-1048-4e53-8551-3b8a795278c0</Id>
      <Version>1.0.0.0</Version>
      <ProviderName>[Provider name]</ProviderName>
      <DefaultLocale>en-US</DefaultLocale>
      <DisplayName DefaultValue="AddinCommands" />
      <Description DefaultValue="AddinCommands"/>
      <Hosts>
        <Host Name="Mailbox" />
      </Hosts>
      <Requirements>
        <Sets>
          <Set Name="MailBox" MinVersion="1.1" />
        </Sets>
      </Requirements>
      <FormSettings>
        <Form xsi:type="ItemRead">
          <DesktopSettings>
            <SourceLocation DefaultValue="~remoteAppUrl/AppRead/Home/Home.html"/>
            <RequestedHeight>250</RequestedHeight>
          </DesktopSettings>
        </Form>
        <Form xsi:type="ItemEdit">
          <DesktopSettings>
            <SourceLocation DefaultValue="~remoteAppUrl/AppCompose/Home/Home.html"/>
          </DesktopSettings>
        </Form>
      </FormSettings>
      <Permissions>ReadWriteItem</Permissions>
      <Rule xsi:type="RuleCollection" Mode="Or">
        <Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit" />
        <Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Edit" />
        <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
        <Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Read" />
      </Rule>
      <DisableEntityHighlighting>true</DisableEntityHighlighting>
      <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="residDesktopFuncUrl" />
              <ExtensionPoint xsi:type="MessageComposeCommandSurface">
                <OfficeTab id="TabDefault">
                  <Group id="msgreadTabMessage.grp1">
                    <Label resid="residTemplateManagement" />
                    <Tooltip resid="residTemplateManagementTip" />
                    <Control xsi:type="Button" id="msgreadTabMessage.grp1.btnView">
                      <Label resid="residViewTemplates" />
                      <Tooltip resid="residViewTemplatesTip" />
                      <Supertip>
                        <Title resid="residVewAndManageTemplates" />
                        <Description resid="residViewManageTemplatesSprTip" />
                      </Supertip>
                      <Icon>
                        <bt:Image size="16" resid="icon1_16x16" />
                        <bt:Image size="32" resid="icon1_32x32" />
                        <bt:Image size="80" resid="icon1_80x80" />
                      </Icon>
                      <Action xsi:type="ShowTaskpane">
                        <SourceLocation resid="residManageTemplatesUrl" />
                      </Action>
                    </Control>
                  </Group>
                </OfficeTab>
              </ExtensionPoint>
            </DesktopFormFactor>
          </Host>
        </Hosts>
        <Resources>
          <bt:Images>
            <bt:Image id="icon1_16x16" DefaultValue="myProjectFolder/Images/16.png" />
            <bt:Image id="icon1_32x32" DefaultValue="myProjectFolder/Images/32.png" />
            <bt:Image id="icon1_80x80" DefaultValue="myProjectFolder/Images/64.png" />
          </bt:Images>
          <bt:Urls>
            <!--modify-->
            <bt:Url id="residDesktopFuncUrl" DefaultValue="~remoteAppUrl/AppCompose/Home/Home.html" />
            <bt:Url id="residManageTemplatesUrl" DefaultValue="~remoteAppUrl/AppCompose/Home/Home.html">
            </bt:Url>
          </bt:Urls>
          <bt:ShortStrings>
            <bt:String id="residTemplateManagement" DefaultValue="residTemplateManagement" />
            <bt:String id="residViewTemplates" DefaultValue="residViewTemplates" />
            <bt:String id="residVewAndManageTemplates" DefaultValue="residVewAndManageTemplates" />
          </bt:ShortStrings>
          <bt:LongStrings>
            <bt:String id="residDescription" DefaultValue="This is the residDescription"></bt:String>
            <bt:String id="residTemplateManagementTip" DefaultValue="This is the residTemplateManagementTip"></bt:String>
            <bt:String id="residViewTemplatesTip" DefaultValue="This is the residViewTemplatesTip"></bt:String>
            <bt:String id="residViewManageTemplatesSprTip" DefaultValue="This is the residViewManageTemplatesSprTip"></bt:String>
          </bt:LongStrings>
        </Resources>
      </VersionOverrides>
    </OfficeApp>
    
    
    Here is the screenshot for your reference:

    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.

    • Marked as answer by JVimes3 Wednesday, August 19, 2015 3:51 PM
    Wednesday, August 12, 2015 9:27 AM

All replies

  • Hi JVimes3,

    >>But the add-in stops loading as soon as I add the VersionOverrides section, and I have XML validation warnings. <<

    Did you get any error message? I am trying to use the manifest you proved to reproduce the issue, however failed.

    Here is the manifest I tested for your reference:

    <?xml version="1.0" encoding="UTF-8"?>
    <!--Created:cb85b80c-f585-40ff-8bfc-12ff4d0e34a9-->
    <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>7ef0fb73-1048-4e53-8551-3b8a795278c0</Id>
      <Version>1.0.0.0</Version>
      <ProviderName>[Provider name]</ProviderName>
      <DefaultLocale>en-US</DefaultLocale>
      <DisplayName DefaultValue="AddinCommands" />
      <Description DefaultValue="AddinCommands"/>
      <Hosts>
        <Host Name="Mailbox" />
      </Hosts>
      <Requirements>
        <Sets>
          <Set Name="MailBox" MinVersion="1.1" />
        </Sets>
      </Requirements>
      <FormSettings>
        <Form xsi:type="ItemRead">
          <DesktopSettings>
            <SourceLocation DefaultValue="~remoteAppUrl/AppRead/Home/Home.html"/>
            <RequestedHeight>250</RequestedHeight>
          </DesktopSettings>
        </Form>
        <Form xsi:type="ItemEdit">
          <DesktopSettings>
            <SourceLocation DefaultValue="~remoteAppUrl/AppCompose/Home/Home.html"/>
          </DesktopSettings>
        </Form>
      </FormSettings>
      <Permissions>ReadWriteItem</Permissions>
      <Rule xsi:type="RuleCollection" Mode="Or">
        <Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit" />
        <Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Edit" />
        <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
        <Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Read" />
      </Rule>
      <DisableEntityHighlighting>true</DisableEntityHighlighting>
      <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="residDesktopFuncUrl" />
              <ExtensionPoint xsi:type="MessageComposeCommandSurface">
                <OfficeTab id="TabDefault">
                  <Group id="msgreadTabMessage.grp1">
                    <Label resid="residTemplateManagement" />
                    <Tooltip resid="residTemplateManagementTip" />
                    <Control xsi:type="Button" id="msgreadTabMessage.grp1.btnView">
                      <Label resid="residViewTemplates" />
                      <Tooltip resid="residViewTemplatesTip" />
                      <Supertip>
                        <Title resid="residVewAndManageTemplates" />
                        <Description resid="residViewManageTemplatesSprTip" />
                      </Supertip>
                      <Icon>
                        <bt:Image size="16" resid="icon1_16x16" />
                        <bt:Image size="32" resid="icon1_32x32" />
                        <bt:Image size="80" resid="icon1_80x80" />
                      </Icon>
                      <Action xsi:type="ShowTaskpane">
                        <SourceLocation resid="residManageTemplatesUrl" />
                      </Action>
                    </Control>
                  </Group>
                </OfficeTab>
              </ExtensionPoint>
            </DesktopFormFactor>
          </Host>
        </Hosts>
        <Resources>
          <bt:Images>
            <bt:Image id="icon1_16x16" DefaultValue="myProjectFolder/Images/16.png" />
            <bt:Image id="icon1_32x32" DefaultValue="myProjectFolder/Images/32.png" />
            <bt:Image id="icon1_80x80" DefaultValue="myProjectFolder/Images/64.png" />
          </bt:Images>
          <bt:Urls>
            <!--modify-->
            <bt:Url id="residDesktopFuncUrl" DefaultValue="~remoteAppUrl/AppCompose/Home/Home.html" />
            <bt:Url id="residManageTemplatesUrl" DefaultValue="~remoteAppUrl/AppCompose/Home/Home.html">
            </bt:Url>
          </bt:Urls>
          <bt:ShortStrings>
            <bt:String id="residTemplateManagement" DefaultValue="residTemplateManagement" />
            <bt:String id="residViewTemplates" DefaultValue="residViewTemplates" />
            <bt:String id="residVewAndManageTemplates" DefaultValue="residVewAndManageTemplates" />
          </bt:ShortStrings>
          <bt:LongStrings>
            <bt:String id="residDescription" DefaultValue="This is the residDescription"></bt:String>
            <bt:String id="residTemplateManagementTip" DefaultValue="This is the residTemplateManagementTip"></bt:String>
            <bt:String id="residViewTemplatesTip" DefaultValue="This is the residViewTemplatesTip"></bt:String>
            <bt:String id="residViewManageTemplatesSprTip" DefaultValue="This is the residViewManageTemplatesSprTip"></bt:String>
          </bt:LongStrings>
        </Resources>
      </VersionOverrides>
    </OfficeApp>
    
    
    Here is the screenshot for your reference:

    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.

    • Marked as answer by JVimes3 Wednesday, August 19, 2015 3:51 PM
    Wednesday, August 12, 2015 9:27 AM
  • Ah, thank you Fei Xue. Your manifest works. My URLs were wrong. I needed to use "~remoteAppUrl", which I tried earlier but must have had something else wrong at the time. I also was referencing the AppRead rather than AppCompose, but that throws an exception I can see.

    For my original problem, no error was shown and no exception caught in the debugger. Is there a log I should have been looking in?

    Wednesday, August 12, 2015 6:28 PM
  • Hi Jvime3,

    >>For my original problem, no error was shown and no exception caught in the debugger. Is there a log I should have been looking in?<<

    You can find the web developer tools which can listen HTTP request. Then you can get the result of the HTTP request.

    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.

    Wednesday, August 19, 2015 9:24 AM
  • >>>My URLs were wrong. I needed to use "~remoteAppUrl", which I tried earlier but must have had something else wrong at the time.
     
    I suggest you to ensure the link of HTML page is correct, you can visit the web page in the web browser first.
    If you URLS is wrong, Development Environment couldn't detect your URLs wrong, so no error was shown and no exception caught in the debugger.

    Otherwise I suggest you can use Fiddler that can also be used to modify ("fiddle with") HTTP traffic for troubleshooting purposes as it is being sent or received.

    Wednesday, August 19, 2015 9:35 AM