0
votes

I am looking a way to "catch" the click event of the upper left save button: enter image description here

How can i create a custom handle to this event? (the click event)

4

4 Answers

0
votes

I don't think you can repurpose or override the behavior of a QAT button, but a better choice would be to intercept the AppointmentItem.Write event.

0
votes

It doesn't matter where the ribbon buttons are located.

You can use the following ribbon XML markup to repurpose the Save button, it works just fine on my PC with Outlook 2013:

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

See Temporarily Repurpose Commands on the Office Fluent Ribbon for more information.

0
votes

This sample is for 2013 to 2016 outlook add-in projects. Called when you click save button or send meeting

    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;
            }

} }

0
votes
    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 
}
}