Get the IDs of all the controls of Office 2010 ribbon and interact with ribbon shortcut from custom Add-ins

Rokr_13 picture Rokr_13 · Sep 28, 2012 · Viewed 10.6k times · Source

I want to get all the controls list in the powerpoint 2010 ribbon like the one in the powerpoint option -> customize ribbon-> all commands.

Furthermore, I want to interact with ribbon shortcut from custom Add-ins

Answer

Aelios picture Aelios · Sep 28, 2012

You will find all office id's you want on microsoft website http://www.microsoft.com/en-us/download/details.aspx?id=6627.

You will find your id's in PowerPointControls.xlsx file.

For create you own menu :

Open your Ribbon.xml

And add following after <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>

For a custom addin shortcut, I think you have to add a new tab :

<tab id="YourTab" visible="true" label="Name">
    <group id="YourGroup" label="name">
      <button onAction="CallAddinsHere();" label="Call add-ins"/>
    </group>
  </tab>

If you want to interact with custom addin shortcut, have a look at :

Automate Office Ribbon through MSAA (CSOfficeRibbonAccessibility)