skip to Main Content

I want to make a Microsoft Word add in that only introduces XML commands in the manifest; that is, it does not need a task pane. Is this possible? Are there any examples of what that might look like, or alternative means of doing this? I cannot see any examples here: https://learn.microsoft.com/en-us/office/dev/add-ins/develop/create-addin-commands.

2

Answers


  1. Yes possible you can create only command add-in for Word using Office js

    please read this documentation and implement it if you need any help so I can help you

    https://learn.microsoft.com/en-us/office/dev/add-ins/develop/yeoman-generator-overview

    Login or Signup to reply.
  2. Yes. You can do this. Here is an example manifest for a Word add-in that only has a function command; no taskpane.

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- To learn about the Office Add-ins XML manifest, see https://go.microsoft.com/fwlink/?linkid=2252563 -->
    <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:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides"
          xsi:type="TaskPaneApp">
    
    <Id>8978b286-b4e3-4167-b256-8347a6794793</Id>
    <Version>1.0.0.0</Version>
    <ProviderName>[Provider name]</ProviderName>
    <DefaultLocale>en-US</DefaultLocale>
    <DisplayName DefaultValue="WordWebAddIn-UpdateTemplate" />
    <Description DefaultValue="WordWebAddIn-UpdateTemplate"/>
    <IconUrl DefaultValue="https://localhost:3000/Images/Button32x32.png" />
    <SupportUrl DefaultValue="http://www.contoso.com" />
    <AppDomains>
      <AppDomain>AppDomain1</AppDomain>
      <AppDomain>AppDomain2</AppDomain>
      <AppDomain>AppDomain3</AppDomain>
    </AppDomains>
    
    <Hosts>
      <Host Name="Document" />
    </Hosts>
    <DefaultSettings>
      <SourceLocation DefaultValue="https://localhost:3000/Home.html" />
    </DefaultSettings>
    
    <Permissions>ReadWriteDocument</Permissions>
    
    <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Hosts>
      <Host xsi:type="Document">
        <DesktopFormFactor>
          <GetStarted>
            <Title resid="Contoso.GetStarted.Title"/>
            <Description resid="Contoso.GetStarted.Description"/>
            <LearnMoreUrl resid="Contoso.GetStarted.LearnMoreUrl"/>
          </GetStarted>
          <FunctionFile resid="Contoso.DesktopFunctionFile.Url" />
    
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <OfficeTab id="TabHome">
              <Group id="Contoso.Group1">
                <Label resid="Contoso.Group1Label" />
                <Icon>
                  <bt:Image size="16" resid="Contoso.tpicon_16x16" />
                  <bt:Image size="32" resid="Contoso.tpicon_32x32" />
                  <bt:Image size="80" resid="Contoso.tpicon_80x80" />
                </Icon>
                <Control xsi:type="Button" id="Contoso.FunctionCommandButton">
                  <Label resid="Contoso.FunctionCommand.Label" />
                  <Supertip>
                    <Title resid="Contoso.FunctionCommand.Label" />
                    <Description resid="Contoso.FunctionCommand.Tooltip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Contoso.tpicon_16x16" />
                    <bt:Image size="32" resid="Contoso.tpicon_32x32" />
                    <bt:Image size="80" resid="Contoso.tpicon_80x80" />
                  </Icon>
                  <Action xsi:type="ExecuteFunction">
                    <FunctionName>insertParagraph</FunctionName>
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>
    
        <Resources>
          <bt:Images>
            <bt:Image id="Contoso.tpicon_16x16" DefaultValue="https://localhost:3000/Images/Button16x16.png" />
            <bt:Image id="Contoso.tpicon_32x32" DefaultValue="https://localhost:3000/Images/Button32x32.png" />
            <bt:Image id="Contoso.tpicon_80x80" DefaultValue="https://localhost:3000/Images/Button80x80.png" />
          </bt:Images>
          <bt:Urls>
            <bt:Url id="Contoso.DesktopFunctionFile.Url" DefaultValue="https://localhost:3000/Functions/FunctionFile.html" />
            <bt:Url id="Contoso.GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812" />
          </bt:Urls>
          <bt:ShortStrings>
            <bt:String id="Contoso.FunctionCommand.Label" DefaultValue="Insert Paragraph" />
            <bt:String id="Contoso.Group1Label" DefaultValue="Commands Group" />
            <bt:String id="Contoso.GetStarted.Title" DefaultValue="Get started with your sample add-in!" />
          </bt:ShortStrings>
          <bt:LongStrings>
            <bt:String id="Contoso.FunctionCommand.Tooltip" DefaultValue="Click to run a function command." />
            <bt:String id="Contoso.GetStarted.Description" DefaultValue="Your sample add-in loaded successfully. Go to the HOME tab and click the 'Show Task Pane' button to get started." />
          </bt:LongStrings>
        </Resources>
      </VersionOverrides>
    </OfficeApp>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search