Dot-Net

獲取 Office 2010 功能區的所有控制項的 ID,並與自定義載入項中的功能區快捷方式進行互動

  • September 21, 2016

我想在 powerpoint 2010 功能區中獲取所有控制項列表,就像在 powerpoint 選項中的一樣-> 自定義功能區-> 所有命令。

此外,我想與自定義載入項中的功能區快捷方式進行互動

您可以在 microsoft 網站http://www.microsoft.com/en-us/download/details.aspx?id=6627上找到您想要的所有 office id 。

PowerPointControls.xlsx您將在文件中找到您的 id 。

創建您自己的菜單:

打開你的 Ribbon.xml

並在之後添加以下內容<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>

對於自定義外掛快捷方式,我認為您必須添加一個新選項卡:

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

如果您想與自定義外掛快捷方式互動,請查看:

通過 MSAA 自動化 Office 功能區 (CSOfficeRibbonAccessibility)

引用自:https://stackoverflow.com/questions/12639337