ms-wordoffice-jsoffice-addinsword-addins

Context Menu Add-in Command(Word) [ExtensionPoint xsi:type="ContextMenu"]


I am using this example from the Microsoft Docs to add a button in the context menu, I am running the validator and the manifest file is valid. This ExtensionPoint is right below the PrimaryCommandSurface ExtensionPoint.When I add the ContextMenu ExtensionPoint, the Add-in is no longer visible in "My Add-ins", if I remove everything in the Control(inside OfficeMenu) then it appears again. Has anyone run into this issue?

p.s: In my example all the resid-s are mapped correctly to the resources declared Inside Resources.

                    <ExtensionPoint xsi:type="ContextMenu">
                    <OfficeMenu id="ContextMenuText">
                        <Control xsi:type="Button" id="Button2Id1">
                            <Label resid="residLabel2" />
                            <Supertip>
                                <Title resid="residLabel" />
                                <Description resid="residToolTip" />
                            </Supertip>
                            <Icon>
                                <bt:Image size="16" resid="icon2_32x32" />
                                <bt:Image size="32" resid="icon2_32x32" />
                                <bt:Image size="80" resid="icon2_32x32" />
                            </Icon>
                            <Action xsi:type="ShowTaskpane">
                                <SourceLocation resid="residUnitConverterUrl" />
                            </Action>
                        </Control>
                    </OfficeMenu>
                </ExtensionPoint>

Solution

  • I found this approach which solved my issue:

                        <ExtensionPoint xsi:type="ContextMenu">
                        <OfficeMenu id="ContextMenuText">
                            <Control xsi:type="Button" id="ContextMenuButton">
                                <Label resid="ContextMenu.Label"/>
                                <Supertip>
                                    <Title resid="ContextMenu.Label"/>
                                    <Description resid="TaskpaneButton.Tooltip"/>
                                </Supertip>
                                <Icon>
                                    <bt:Image size="16" resid="Icon.16x16"/>
                                    <bt:Image size="32" resid="Icon.32x32"/>
                                    <bt:Image size="80" resid="Icon.80x80"/>
                                </Icon>
                                <Action xsi:type="ShowTaskpane"<TaskpaneId>ButtonId1</TaskpaneId> <SourceLocation resid="Contoso.Taskpane.Url" /></Action>
                            </Control>
                        </OfficeMenu>
                    </ExtensionPoint>