Outlook约会功能区窗口保存按钮事件

时间:2015-05-05 16:59:36

标签: .net vsto outlook-addin

我正在寻找一种方法来捕捉"左上角保存按钮的click事件: enter image description here

如何为此活动创建自定义句柄? (点击事件)

4 个答案:

答案 0 :(得分:0)

我认为你不能重新调整或覆盖QAT按钮的行为,但更好的选择是截取AppointmentItem.Write event

答案 1 :(得分:0)

功能区按钮的位置无关紧要。

您可以使用以下功能区XML标记重新调整“保存”按钮,它可以在我的PC上使用Outlook 2013正常工作:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="ribbonLoaded" loadImage="getImages">
 <commands>
   <command idMso="FileSave" onAction="onActionRepurposed" />
 </commands>
</customUI>

有关详细信息,请参阅Temporarily Repurpose Commands on the Office Fluent Ribbon

答案 2 :(得分:0)

此示例适用于2013至2016年的Outlook加载项目。单击“保存”按钮或发送会议

时调用
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Xml.Linq;
    using Outlook = Microsoft.Office.Interop.Outlook;
    using Office = Microsoft.Office.Core;

    namespace blah
    {
        public partial class ThisAddIn
        {
            public bool Appointment { get; set; }
            public bool NewAppointment { get; set; }
            public Outlook.Inspector CurrentInspector { get;  set; }
            private void ThisAddIn_Startup(object sender, System.EventArgs e)
            {
                Application.Inspectors.NewInspector += InspectorOnNewInspector;
            }

        //Save event of appt or meeting
                 ((Outlook.AppointmentItem)inspector.CurrentItem).Write += OnWrite;
            }

} }

答案 3 :(得分:0)

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Xml.Linq;
    using Outlook = Microsoft.Office.Interop.Outlook;
    using Office = Microsoft.Office.Core;
 namespace blah
    {
        public partial class ThisAddIn
        {
 public bool Appointment { get; set; }
 public bool NewAppointment { get; set; }
 public Outlook.Inspector CurrentInspector { get;  set; }
 private void ThisAddIn_Startup(object sender, System.EventArgs e)
 {
Application.Inspectors.NewInspector += InspectorOnNewInspector;
}
//Plz can you specify where to write the  
 ((Outlook.AppointmentItem)inspector.CurrentItem).Write += OnWrite;

//as it call two time for my function 
}
}