Can an Office Add-in be displayed in multiple Office tabs?

Hieu Doan 20 Reputation points
2023-11-25T03:48:13.46+00:00

I want to display my add-in in multiple Office tabs. Link to Microsoft Docs

Is it possible to do that?

For example, display the add-in in TabDesign and TabHome

<ExtensionPoint xsi:type="PrimaryCommandSurface">
     <OfficeTab id="TabDesign">
     ...
      </OfficeTab>
      <OfficeTab id="TabHome">
       ...
      </OfficeTab>
</ExtensionPoint>

Word
Word
A family of Microsoft word processing software products for creating web, email, and print documents.
960 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,367 questions
{count} votes

Accepted answer
  1. Vahid Ghafarpour 23,300 Reputation points Volunteer Moderator
    2023-11-25T04:00:33.8766667+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    However, the OfficeTab element is not directly used within the PrimaryCommandSurface. Instead, you can use the Group element to define different command groups for each tab.

    <OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" ...>
      <AddIn ...>
        ...
        <Extensions>
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <!-- Command Groups for TabHome -->
            <OfficeTab id="TabHome">
              <Group id="MyGroupHome">
                <Label resid="MyGroup.Home.Label" />
                <Icon>
                  <bt:Image size="16" resid="MyGroup.Home.Icon" />
                  <bt:Image size="32" resid="MyGroup.Home.Icon" />
                  <bt:Image size="80" resid="MyGroup.Home.Icon" />
                </Icon>
                <Control xsi:type="Button" id="MyButtonHome">
                  ...
                </Control>
              </Group>
            </OfficeTab>
    
            <!-- Command Groups for TabDesign -->
            <OfficeTab id="TabDesign">
              <Group id="MyGroupDesign">
                <Label resid="MyGroup.Design.Label" />
                <Icon>
                  <bt:Image size="16" resid="MyGroup.Design.Icon" />
                  <bt:Image size="32" resid="MyGroup.Design.Icon" />
                  <bt:Image size="80" resid="MyGroup.Design.Icon" />
                </Icon>
                <Control xsi:type="Button" id="MyButtonDesign">
                  ...
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </Extensions>
      </AddIn>
    </OfficeApp>
    
    
    

    ** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful **

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Hieu Doan 20 Reputation points
    2023-11-25T04:19:14.09+00:00

    @Vahid Ghafarpour : It does not working for me, It's passing the validation but does not show up in side loading

    <ExtensionPoint xsi:type="PrimaryCommandSurface">
                            <OfficeTab id="TabDesign">
                                <Group id="Designer">
                                    <Label resid="ow365.Main.Label" />
                                    <Icon>
                                        <bt:Image size="16" resid="Designer.Icon16" />
                                        <bt:Image size="32" resid="Designer.Icon32" />
                                        <bt:Image size="80" resid="Designer.Icon80" />
                                    </Icon>
                                    <Control xsi:type="Button" id="DesignTemplate">
                                        <Label resid="ow365.Main.Design.String" />
                                        <Supertip>
                                            <Title resid="ow365.Main.Design.String" />
                                            <Description resid="ow365.Desc" />
                                        </Supertip>
                                        <Icon>
                                            <bt:Image size="16" resid="Designer.Icon16" />
                                            <bt:Image size="20" resid="Designer.Icon20" />
                                            <bt:Image size="24" resid="Designer.Icon24" />
                                            <bt:Image size="32" resid="Designer.Icon32" />
                                            <bt:Image size="40" resid="Designer.Icon40" />
                                            <bt:Image size="48" resid="Designer.Icon48" />
                                            <bt:Image size="64" resid="Designer.Icon64" />
                                            <bt:Image size="80" resid="Designer.Icon80" />
                                        </Icon>
                                        <Action xsi:type="ShowTaskpane">
                                            <TaskpaneId>Office.AutoShowTaskpaneWithDocument</TaskpaneId>
                                            <SourceLocation resid="DesignerIndex.Url" />
                                        </Action>
                                    </Control>
                                    <Control xsi:type="Button" id="PreviewDocument">
                                        <Label resid="ow365.Main.Preview.String" />
                                        <Supertip>
                                            <Title resid="ow365.Main.Preview.String" />
                                            <Description resid="ow365.Desc" />
                                        </Supertip>
                                        <Icon>
                                            <bt:Image size="16" resid="Preview.Icon16" />
                                            <bt:Image size="20" resid="Preview.Icon20" />
                                            <bt:Image size="24" resid="Preview.Icon24" />
                                            <bt:Image size="32" resid="Preview.Icon32" />
                                            <bt:Image size="40" resid="Preview.Icon40" />
                                            <bt:Image size="48" resid="Preview.Icon48" />
                                            <bt:Image size="64" resid="Preview.Icon64" />
                                            <bt:Image size="80" resid="Preview.Icon80" />
                                        </Icon>
                                        <Action xsi:type="ShowTaskpane">
                                            <TaskpaneId>TP2</TaskpaneId>
                                            <SourceLocation resid="WizardIndex.Url" />
                                        </Action>
                                    </Control>
                                </Group>
                            </OfficeTab>
                            <OfficeTab id="TabSlideMaster">
                                <Group id="DesignerSlideMaster">
                                    <Label resid="ow365.Main.Label" />
                                    <Icon>
                                        <bt:Image size="16" resid="Designer.Icon16" />
                                        <bt:Image size="32" resid="Designer.Icon32" />
                                        <bt:Image size="80" resid="Designer.Icon80" />
                                    </Icon>
                                    <Control xsi:type="Button" id="DesignTemplate">
                                        <Label resid="ow365.Main.Design.String" />
                                        <Supertip>
                                            <Title resid="ow365.Main.Design.String" />
                                            <Description resid="ow365.Desc" />
                                        </Supertip>
                                        <Icon>
                                            <bt:Image size="16" resid="Designer.Icon16" />
                                            <bt:Image size="20" resid="Designer.Icon20" />
                                            <bt:Image size="24" resid="Designer.Icon24" />
                                            <bt:Image size="32" resid="Designer.Icon32" />
                                            <bt:Image size="40" resid="Designer.Icon40" />
                                            <bt:Image size="48" resid="Designer.Icon48" />
                                            <bt:Image size="64" resid="Designer.Icon64" />
                                            <bt:Image size="80" resid="Designer.Icon80" />
                                        </Icon>
                                        <Action xsi:type="ShowTaskpane">
                                            <TaskpaneId>Office.AutoShowTaskpaneWithDocument</TaskpaneId>
                                            <SourceLocation resid="DesignerIndex.Url" />
                                        </Action>
                                    </Control>
                                    <Control xsi:type="Button" id="PreviewDocument">
                                        <Label resid="ow365.Main.Preview.String" />
                                        <Supertip>
                                            <Title resid="ow365.Main.Preview.String" />
                                            <Description resid="ow365.Desc" />
                                        </Supertip>
                                        <Icon>
                                            <bt:Image size="16" resid="Preview.Icon16" />
                                            <bt:Image size="20" resid="Preview.Icon20" />
                                            <bt:Image size="24" resid="Preview.Icon24" />
                                            <bt:Image size="32" resid="Preview.Icon32" />
                                            <bt:Image size="40" resid="Preview.Icon40" />
                                            <bt:Image size="48" resid="Preview.Icon48" />
                                            <bt:Image size="64" resid="Preview.Icon64" />
                                            <bt:Image size="80" resid="Preview.Icon80" />
                                        </Icon>
                                        <Action xsi:type="ShowTaskpane">
                                            <TaskpaneId>TP2</TaskpaneId>
                                            <SourceLocation resid="WizardIndex.Url" />
                                        </Action>
                                    </Control>
                                </Group>
                            </OfficeTab>
                        </ExtensionPoint>
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.