DEV Community

Cover image for What is XML manifest in Office Add-in?
Harshal Suthar
Harshal Suthar

Posted on • Originally published at ifourtechnolab.com

What is XML manifest in Office Add-in?

The office add-in platform which is used to build application which extends office application and used to interact with the content of office document. Using office add-in, developer can use HTML, CSS, JavaScript to interact with Word, Excel, PowerPoint, Outlook. These applications can run across multiple platforms like Windows, Mac, iPad, and in a browser. Office add-in can do anything which a webpage can do inside a browser.

Image description

Using office add-in, developer can do the following things:

Add new functionality to office client:
Using Office add-in, the developer can use external data into the office, add third-party functionality, automate office documents, in-office clients. Example: Microsoft graph API which is used to drives productivity.

Create a new, interactive object which can be embedded in the office document:

Office add-in can provide maps, charts, and provide interactive visualization so that developers can add custom excel sheet and power point presentation.

Office Add-ins XML Manifest

Introduction

The XML manifest file of Office Add-in is used to describe how your add-in should be activated when any user installs and uses it with documents and applications. The manifest file contains referenced URLs where your web application can reside and other resources for add-in like images. The offappmanifest.xsd is used to describe XML schema that is common to office applications like rich client application and their corresponding web client.

Note: Manifest schema version 1.1 must use in office Add-in.

An XML manifest file is based on schema which enables an office-Add-in which is used to do the following things:

  • The XML file is used to describe itself using Id, Version, and Description display name and default locale.
  • The XML file is used to specify the location of the HTML which is used to provide the User-Interface of office Add-in.
  • The XML file is used to specify the requested default dimension for content add-in and also the requested height for outlook add-in.
  • The XML file is used to define permission used by office add-in for reading or writing purposes.
  • The XML file is used to display content in the document, in the task pane, or contextually with a message, appointment, or meeting request item.
  • XML file defines rules which are used to specify the context in which they will be activated or interact using message, appointment, or meeting request item for outlook add-in.

Read More: Office Add-in Development: Vsto Add-ins Vs Javascript Api

Manifest v1.1 XML file examples and schemas

The following example show content, task panel, Outlook, and dictionary office add-in:

In Visual Studio, Visual studio manifest designer is used to office add-in manifest setting rather than manually changing XML. By default Visual studio manifest file is opened in the manifest designer. Using manifest, designer makes it easier to find and reduce data-entry error in the drop-down list box.

Example of Content Office Add-in Manifestv1.1
Content Add-in:

Content office add-in can be directly included in excel or power point and used to add functionality directly into the document. Content add-in provide user interface to run code to edit document or display data from data source.

                                                  <!--?xml encoding="utf-8" version="1.0"-->
<!--?xml encoding="utf-8" version="1.0"-->
<officeapp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ContentApp">
                    <id>01eac144-e55a-45a7-b6e3-f1cc60ab0126</id>
                    <alternateid>en-US\WA123456789</alternateid>
                    <version>1.0.0.0</version>
                    <providername>Microsoft</providername>
                    <defaultlocale>en-US</defaultlocale>
                    <displayname defaultvalue="Sample content add-in">
                    <description defaultvalue="Describe the features of this app.">
                    <iconurl defaultvalue="https://contoso.com/ENUSIcon.webp">
                    <hosts>
                    <host name="Workbook">
                    <host name="Database">
  </host></host></hosts>
                    <requirements>
                    <sets defaultminversion="1.1">
                    <set name="TableBindings">
    </set></sets>
  </requirements>  
                    <defaultsettings>
                    <sourcelocation defaultvalue="https://contoso.com/apps/content.html">
                    <requestedwidth>400</requestedwidth> 
                    <requestedheight>400</requestedheight>
  </sourcelocation></defaultsettings>
                    <permissions>Restricted</permissions>
                    <allowsnapshot>true</allowsnapshot>
</iconurl></description></displayname></officeapp>

<!--?xml-->

Enter fullscreen mode Exit fullscreen mode

Image description
Figure: Content add-in layout

Example of Task-panel Office Add-in Manifestv1.1 Task panel add-in:

Task panel provide interface which typically display on right-side of window inside word, outlook, PowerPoint. Task panel add-in provide user interface to run code to edit document or emails, display data from data source. Task panel is used when no need to add functionality directly into document.

<!--?xml encoding="utf-8" version="1.0"-->
                                              <!--?xml encoding="UTF-8" version="1.0"-->
<officeapp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="TaskPaneApp">
                    <id>412ce350-4161-4ad0-a5f5-0ec9d2cd3570</id>
                    <version>1.0.0.0</version>
                    <providername>Microsoft</providername>
                    <defaultlocale>en-US</defaultlocale>
                    <displayname defaultvalue="Sample task pane add-in">
                    <override locale="en-US" value="Project add-in"> 
  </override></displayname>
                    <description defaultvalue="Describe the features of this app.">
                    <override locale="en-US" value="Adds project management information to documents">
  </override></description>
                    <iconurl defaultvalue="https://contoso.com.sa/ProjectApp/Topgunas-SA.webp">
                    <override locale="en-US" value="https://contoso.com/ProjectApp/Topgunen-US.webp">
  </override></iconurl>
                    <appdomains>
                    <appdomain>http://www.projectlogin.com</appdomain>
                    <appdomain>http://m.projectlogin.com</appdomain>
                    <appdomain>http://www.projectlogin.com.sa</appdomain>
                    <appdomain>http://m.projectlogin.com.sa</appdomain>
  </appdomains>
                    <hosts>
                    <host name="Document">
                    <host name="Workbook">
                    <host name="Presentation">
                    <host name="Project">
  </host></host></host></host></hosts>
                    <defaultsettings>
                    <sourcelocation defaultvalue="https://contoso.com.sa/ProjectApp/ProjectAppar_SA.html">
                    <override locale="en-US" value="https://contoso.com/ProjectApp/ProjectAppen-US.html">
    </override></sourcelocation>
  </defaultsettings>
                    <permissions>ReadWriteDocument</permissions>
</officeapp>

                                              <!--?xml-->

Enter fullscreen mode Exit fullscreen mode

Image description

Want to hire Trusted Outlook Add-in Development Company? Your Search ends here.

Example of Outlook Office Add-in Manifestv1.1
Outlook office add-in:

Using outlook add-in, developer can use HML, CSS, JavaScript to build an application that can run multiple platform like windows, Mac, and IOS.


<!--?xml encoding="utf-8" version="1.0"--><!--?xml encoding="UTF-8" version="1.0"-->
  <!--?xml encoding="utf-8" version="1.0"-->
                    <officeapp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="MailApp">

                    <id>971E76EF-D73E-567F-ADAE-5A76B39052CF</id>
                    <version>1.0</version>
                    <providername>Microsoft</providername>
                    <defaultlocale>en-us</defaultlocale>
                    <displayname defaultvalue="YouTube">
                    <description defaultvalue="Watch YouTube videos referenced in the e-mails you
      receive without leaving your email client.">
                    <override locale="fr-fr" value="Visualisez les vid????os
        YouTube r????f????renc????es dans vos courriers ????lectronique
        directement depuis Outlook et Outlook Web App.">
    </override></description>
    <!-- Change the following line to specify    -->
    <!-- the web serverthat hosts the icon file. -->
                    <iconurl defaultvalue="https://webserver/YouTube/YouTubeLogo.webp">

                    <hosts>
                    <host name="Mailbox">
    </host></hosts>
                    <requirements>
                    <sets defaultminversion="1.1">
                    <set name="Mailbox">
      </set></sets>
    </requirements>

                    <formsettings><form xsi:type="ItemRead">
                    <desktopsettings>
          <!-- Change the following line to specify     -->
          <!-- the web server that hosts the HTML file. -->
                    <sourcelocation defaultvalue="https://webserver/YouTube/YouTube_read_desktop.htm">
                    <requestedheight>216</requestedheight>
        </sourcelocation></desktopsettings>
                    <tabletsettings>
          <!-- Change the following line to specify     -->
          <!-- the web server that hosts the HTML file. -->
                    <sourcelocation defaultvalue="https://webserver/YouTube/YouTube_read_tablet.htm">
                    <requestedheight>216</requestedheight>
        </sourcelocation></tabletsettings></form>
<form xsi:type="ItemEdit">
                    <desktopsettings>
          <!-- Change the following line to specify     -->
          <!-- the web server that hosts the HTML file. -->
                    <sourcelocation defaultvalue="https://webserver/YouTube/YouTube_compose_desktop.htm">
        </sourcelocation></desktopsettings>
                    <tabletsettings>
          <!-- Change the following line to specify     -->
          <!-- the web server that hosts the HTML file. -->
                    <sourcelocation defaultvalue="https://webserver/YouTube/YouTube_compose_tablet.htm">
        </sourcelocation></tabletsettings></form>
    </formsettings>

                    <permissions>ReadWriteItem</permissions>
                    <rule mode="Or" xsi:type="RuleCollection"> 
                    <rule mode="And" xsi:type="RuleCollection">
                    <rule mode="Or" xsi:type="RuleCollection">
                    <rule formtype="Read" itemtype="Appointment" xsi:type="ItemIs">
                    <rule formtype="Read" itemtype="Message" xsi:type="ItemIs">
        </rule>
                    <rule propertyname="BodyAsPlaintext" regexname="VideoURL" regexvalue="http://(((www\.)?youtube\.com/watch\?v=)|
          (youtu\.be/))[a-zA-Z0-9_-]{11}" xsi:type="ItemHasRegularExpressionMatch">
      </rule>
                    <rule mode="Or" xsi:type="RuleCollection">
                    <rule formtype="Edit" itemtype="Appointment" xsi:type="ItemIs">
                    <rule formtype="Edit" itemtype="Message" xsi:type="ItemIs"> 
      </rule> 
    </rule>
  </rule></rule></rule></rule></rule></iconurl></displayname></officeapp>

                                              <!--?xml-->

Enter fullscreen mode Exit fullscreen mode

Conclusion

In this blog, we have discussed the office add-in and manifest file in the office add-in. We have also discussed the example of content, task panel, outlook add-in in the office.

Top comments (0)