none
How to get a reference to the AppointmentItem in SaveAndClose event

    Question

  • Here is my xml.

    <command enabled="true" idMso="SaveAndClose" onAction="SaveToMacCalendar"/>
    
    public void SaveToMacCalendar(IRibbonControl control, ref bool cancelDefault)
    {
        //How do I get a reference to the AppointmentItem that is currently being saved and closed?
        cancelDefault = false;
    }
    


    Thank you, Terrence

    Monday, January 14, 2013 5:50 PM

Answers

  • IRiobbonControl.Context property will point to either Inspector or Explorer object depending on where the control is hosted.

    In case of an Inspector. use Inspector.CurrentItem. In case of an Explorer, use the Explorer.Selection collection.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.4 is now available!


    Monday, January 14, 2013 6:05 PM

All replies

  • IRiobbonControl.Context property will point to either Inspector or Explorer object depending on where the control is hosted.

    In case of an Inspector. use Inspector.CurrentItem. In case of an Explorer, use the Explorer.Selection collection.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.4 is now available!


    Monday, January 14, 2013 6:05 PM
  • Dmitry, you are great, thanks so much for your excellent answer.


    Thank you, Terrence

    Monday, January 14, 2013 8:50 PM