简体   繁体   English

Visual C#:将功能区按钮添加到“开始”选项卡? (Outlook加载项)

[英]Visual C#: Add ribbon button to start tab? (Outlook add in)

I´m using the ribbon designer in visual studio 2012 for a outlook add-in. 我正在Visual Studio 2012中使用功能区设计器来添加Outlook外接程序。

I need to add several ribbon buttons to different existing tabs in the Outlook ribbon. 我需要将多个功能区按钮添加到Outlook功能区中的不同现有选项卡。

Right know my button shows up in the "Add in´s" tab, so how do I set it to built in tab? 知道我的按钮显示在“添加到”选项卡中,那么如何将其设置为内置选项卡?

You should just be able to add it as a tab under the tabs element, like in the XML below. 您应该只能将其添加为tabs元素下的标签,就像下面的XML一样。

<?xml version="1.0" encoding="UTF-8"?>
<customUI onLoad="Ribbon_Load" xmlns="http://schemas.microsoft.com/office/2006/01/customui">
   <ribbon>
      <tabs>
         <tab id="MyNewTab" label="My Tab" visible="true">
           <group id="TabGroup" label="My Group" visible="true">
               <button id="TestButton" onAction="TestButton_Click" label="Test Button" size="large" />
           </group>
        </tab>         
     </tabs>
   </ribbon>
</customUI>

I'm not sure how you would do it from the designer but, you can access the Ribbon.xml file and add it that way. 我不确定如何从设计器中执行此操作,但是可以访问Ribbon.xml文件并以这种方式添加它。

Note that that is only for a custom tab. 请注意,这仅适用于自定义标签。 If you want to add it to a built in tab you need to specify it using the idMso of that tab. 如果要将其添加到内置选项卡,则需要使用该选项卡的idMso进行指定。 For example, if you wanted to add it to the appointment tab you could use: 例如,如果要将其添加到约会选项卡,则可以使用:

<tab idMso="TabAppointment">
</tab>

Here is where you can find the control ids . 在这里您可以找到控件ID

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM