在appointmentTab附近展示展望丝带 [英] show outlook ribbon near appointmentTab

查看:151
本文介绍了在appointmentTab附近展示展望丝带的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过ribbonXML创建了新的外观功能区



我想显示此功能区



1 在预约选项卡附近的CalendarItem中,在预约\会议窗口



2。视图



我可以在一个功能区中显示两个选项,但不能一起显示。



contextualTabs






$ b

我想在这两种情况下都显示此功能区。如何操作?



我的代码:

 < ribbon> 
< tabs>
< tab idMso =TabAddInslabel =MyTab>
< group id =group1label =save>
< button id =btnSaveAsonAction =btnSaveAs_Click
imageMso =FileSave/>
< / group>
< / tab>
< / tabs>

< contextualTabs>
< tabSet idMso =TabSetAppointment>
< tab id =TabAppointmentlabel =MyTab>
< group id =MyGrouplabel =save>
< button id =btnSaveAppAsonAction =btnSaveAs_Clicklabel =save
imageMso =FileSave/>
< / group>
< / tab>
< / tabSet>
< / contextualTabs>
< / ribbon>

C#:(因为仅在约会\会议窗口中显示功能区)

  public string GetCustomUI(string ribbonID)
{
if(ribbonID ==Microsoft.Outlook.Appointment)
return GetResourceText(OutlookAddIn.Ribbon.xml);
if(ribbonID ==Microsoft.Outlook.MeetingRequest)
return GetResourceText(OutlookAddIn.Ribbon.xml);
return null;
}


解决方案

/ p>

我把两个选项放在两个单独的xml文件中,并修复了getcustomUI



Ribbon.xml:

 <?xml version =1.0encoding =UTF-8?> 
< customUI xmlns =http://schemas.microsoft.com/office/2006/01/customuionLoad =Ribbon_Load>
< ribbon>
< tabs>
< tab idMso =TabAddInslabel =MyTab>
< group id =group1label =save>
< button id =btnSaveAsonAction =btnSaveAs_Click
imageMso =FileSave/>
< / group>
< / tab>
< / tabs>
< / ribbon>
< / customUI>

CalendarToolsRibbon.xml:

 <?xml version =1.0encoding =UTF-8?> 
< customUI xmlns =http://schemas.microsoft.com/office/2006/01/customuionLoad =Ribbon_Load>
< ribbon>
< contextualTabs>
< tabSet idMso =TabSetAppointment>
< Tab id =TabAppointmentlabel =MyTab>
< group id =MyGrouplabel =save>
< button id =btnSaveAppAsonAction =btnSaveAs_Clicklabel =save
imageMso =FileSave/>
< / group>
< / tab>
< / tabSet>
< / contextualTabs>
< / ribbon>
< / customUI>

C#:

 code> public string GetCustomUI(string ribbonID)
{
if(ribbonID ==Microsoft.Outlook.Appointment)
return GetResourceText(OutlookAddIn.Ribbon.xml);
if(ribbonID ==Microsoft.Outlook.MeetingRequest.Read)
return GetResourceText(OutlookAddIn.Ribbon.xml);
return GetResourceText(OutlookAddIn.CalendarToolsRibbon.xml);
}


I created new outlook ribbon by ribbonXML

I want to show this Ribbon

1. in Appointment\Meeting window

2. in CalendarItems near 'Appointment' tab , when appointment is selected from the calendar view

I can display the two options but not together in one Ribbon.

"contextualTabs" - displays the tab in calendarItems,

"TabAddins" - displays the tab only in appointment\meeting window according to the C# code

I want this Ribbon will be displayed in both of these cases.How can I do it?

My Code:

<ribbon>
  <tabs>
    <tab idMso="TabAddIns" label="MyTab">
      <group id="group1" label="save">
        <button id="btnSaveAs" onAction="btnSaveAs_Click" 
                imageMso="FileSave"/>
      </group>
    </tab>
  </tabs>

 <contextualTabs>      
   <tabSet idMso="TabSetAppointment">
     <tab id="TabAppointment" label="MyTab">
       <group id="MyGroup" label="save">
         <button id="btnSaveAppAs" onAction="btnSaveAs_Click" label="save" 
                 imageMso="FileSave"/>
       </group>
     </tab>
   </tabSet>
 </contextualTabs>
</ribbon>

C#: (cause showing the ribbon only in appointment\meeting window)

public string GetCustomUI(string ribbonID)
    {
        if(ribbonID=="Microsoft.Outlook.Appointment")
            return GetResourceText("OutlookAddIn.Ribbon.xml");
        if (ribbonID == "Microsoft.Outlook.MeetingRequest")
            return GetResourceText("OutlookAddIn.Ribbon.xml");
        return null;
    }

解决方案

I found the solution.

I put the two options in two separate xml files and repaired getcustomUI

Ribbon.xml:

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"     onLoad="Ribbon_Load">
<ribbon>
  <tabs>
    <tab idMso="TabAddIns" label="MyTab">
      <group id="group1" label="save">
        <button id="btnSaveAs" onAction="btnSaveAs_Click" 
                imageMso="FileSave"/>
      </group>
    </tab>
  </tabs>
</ribbon>
</customUI>

CalendarToolsRibbon.xml:

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"     onLoad="Ribbon_Load">
<ribbon>
 <contextualTabs>      
   <tabSet idMso="TabSetAppointment">
     <tab id="TabAppointment" label="MyTab">
       <group id="MyGroup" label="save">
         <button id="btnSaveAppAs" onAction="btnSaveAs_Click" label="save" 
             imageMso="FileSave"/>
       </group>
    </tab>
   </tabSet>
  </contextualTabs>
</ribbon>
</customUI>

C#:

   public string GetCustomUI(string ribbonID)
    {
        if (ribbonID == "Microsoft.Outlook.Appointment")
            return GetResourceText("OutlookAddIn.Ribbon.xml");
        if (ribbonID == "Microsoft.Outlook.MeetingRequest.Read")
            return GetResourceText("OutlookAddIn.Ribbon.xml");
        return GetResourceText("OutlookAddIn.CalendarToolsRibbon.xml");
    }

这篇关于在appointmentTab附近展示展望丝带的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆