0
votes

I followed this MSDN Tutorial to create a WORD 2010 VSTO AddIn Tab. I am using VS2015 Community Edition. When I run the app in Visual Studio, it opens the Word document but the Tab does not show up in WORD (as claimed by the testing steps of the turorial). So, I cannot test the AddIn.

However, I can see the above AddIn in the COM Add-Ins window of the WORD as enabled - as shown in the image below. Also, when I place break point in the following procedure, I can see this procedure is called successfully. Note: I followed the tutorial word by word by copying/pasting the code, project name etc. So, I changed nothing from the tutorial.

protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
{
     return new MyRibbon();
}

enter image description here

UPDATE: The MyRibbon.xml is shown below.

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
  <ribbon>
    <tabs>
      <tab idMso="TabAddIns">  
        <group id="ContentGroup" label="Content">  
            <button id="textButton" label="Insert Text"  
                 screentip="Text" onAction="OnTextButton"  
                 supertip="Inserts text at the cursor location."/>  
            <button id="tableButton" label="Insert Table"  
                 screentip="Table" onAction="OnTableButton"  
                 supertip="Inserts a table at the cursor location."/>  
        </group>  
      </tab> 
    </tabs>
  </ribbon>
</customUI>

UPDATE 2: After reading comment by @dotNET below, I think the the problem seems to be my WORD doc missing the built-in ADD-INS. How can I display the ADD-INS tab? From the customize tabs option in WORD I don't see that tab as shown in the image below. Where should I look?

enter image description here

1
Can u share your ribbon XML?dotNET
@dotNET Sure, I just added ribbon XML file content in UPDATE section.nam

1 Answers

6
votes

Your buttons will be added to the built-in ADD-INS tab using the code you have provided. If you want your own custom tab, do not use idMso. Instead define your <tab> node like this:

<tab id="tabMyVeryOwnCustomTab" label="TRUMPED">
  <group id="ContentGroup" label="Content">  
        <button id="textButton" label="Insert Text"  
             screentip="Text" onAction="OnTextButton"  
             supertip="Inserts text at the cursor location."/>  
        <button id="tableButton" label="Insert Table"  
             screentip="Table" onAction="OnTableButton"  
             supertip="Inserts a table at the cursor location."/>  
  </group>  
</tab>