Add ContextMenu in the web manifest add-in excel VS

0

I need to add an item to the contextual menu in the Manifest of an excel plugin in visual studio 2017. This is the ExtensionPoint with which the project is created:

                                                                                                                                                                                                                      

            <!-- Control. Puede ser de tipo "Button" o "Menu". -->
            <Control xsi:type="Button" id="Contoso.TaskpaneButton">
              <Label resid="Contoso.TaskpaneButton.Label" />
              <Supertip>
                <!-- Título de la información sobre herramientas; resid debe apuntar a un recurso ShortString. -->
                <Title resid="Contoso.TaskpaneButton.Label" />
                <!-- Descripción de la información sobre herramientas; resid debe apuntar a un recurso LongString. -->
                <Description resid="Contoso.TaskpaneButton.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>

              <!-- Esto es lo que ocurre cuando se desencadena el comando (por ejemplo, un clic en la Cinta). Las acciones admitidas son ExecuteFunction o ShowTaskpane. -->
              <Action xsi:type="ShowTaskpane">
                <TaskpaneId>ButtonId1</TaskpaneId>
                <!-- Proporcione un identificador de recurso de dirección URL para la ubicación que se mostrará en el panel de tareas. -->
                <SourceLocation resid="Contoso.Taskpane.Url" />
              </Action>
            </Control>
          </Group>
        </OfficeTab>
      </ExtensionPoint>

And when trying to add the ExtensionPoint for the contextual menu, which is the following:

<ExtensionPoint xsi:type="ContextMenu">
        <!--The id of the menu specifies the existing context menu being extended-->
        <!--ContextMenuCell (Excel) and ContextMenuText (Word) are currently supported-->
        <OfficeMenu id="ContextMenuCell">
          <Control xsi:type="Menu" id="Contoso.TestMenu2">
            <Label resid="Contoso.contextMenu" />
            <Supertip>
              <Title resid="residLabel" />
              <Description resid="residToolTip" />
            </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>
            <Items>
              <Item id="showGallery2">
                <Label resid="Contoso.contextMenu"/>
                <Supertip>
                  <Title resid="Contoso.TaskpaneButton.Label" />
                  <Description resid="residToolTip" />
                </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="ShowTaskpane">
                  <!--TaskPaneId is required. It is currently not used by the framework but it will be in a future iteration -->
                  <TaskpaneId>MyTaskPaneID1</TaskpaneId>
                  <!--The URL to show inside the taskpane -->
                  <SourceLocation resid="residUnitConverterUrl" />
                </Action>
              </Item>
              <Item id="showGallery3">
                <Label resid="Contoso.contextMenu"/>
                <Supertip>
                  <Title resid="Contoso.TaskpaneButton.Label" />
                  <Description resid="residToolTip" />
                </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="ShowTaskpane">
                  <TaskpaneId>MyTaskPaneID2</TaskpaneId>
                  <SourceLocation resid="residUnitConverterUrl" />
                </Action>
              </Item>
            </Items>
          </Control>
        </OfficeMenu>
      </ExtensionPoint>

When I compile and try I get the following error:

The configuration of the resources is as follows:

   <Resources>
  <bt:Images>
    <bt:Image id="Contoso.tpicon_16x16" DefaultValue="~remoteAppUrl/Images/Button16x16.png" />
    <bt:Image id="Contoso.tpicon_32x32" DefaultValue="~remoteAppUrl/Images/Button32x32.png" />
    <bt:Image id="Contoso.tpicon_80x80" DefaultValue="~remoteAppUrl/Images/Button80x80.png" />
  </bt:Images>
  <bt:Urls>
    <bt:Url id="Contoso.DesktopFunctionFile.Url" DefaultValue="~remoteAppUrl/Functions/FunctionFile.html" />
    <bt:Url id="Contoso.Taskpane.Url" DefaultValue="~remoteAppUrl/Home.html" />
    <bt:Url id="Contoso.GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812" />
  </bt:Urls>
  <!-- ShortStrings max characters==125. -->
  <bt:ShortStrings>
    <bt:String id="Contoso.TaskpaneButton.Label" DefaultValue="Show Taskpane" />
    <bt:String id="Contoso.Group1Label" DefaultValue="Commands Group" />
    <bt:String id="Contoso.GetStarted.Title" DefaultValue="Get started with your sample add-in!" />
    <bt:String id ="Contoso.contextMenu" DefaultValue="Menu contextual 1"/>
  </bt:ShortStrings>
  <!-- LongStrings max characters==250. -->
  <bt:LongStrings>
    <bt:String id="Contoso.TaskpaneButton.Tooltip" DefaultValue="Click to Show a Taskpane" />
    <bt:String id="Contoso.GetStarted.Description" DefaultValue="Your sample add-in loaded succesfully. Go to the HOME tab and click the 'Show Taskpane' button to get started." />
  </bt:LongStrings>
</Resources>
    
asked by seba z 23.04.2018 в 19:21
source

0 answers