none
Access email from the button click of Contextual Tabs [Compose Tools] RRS feed

  • Question

  • Hi

    I've a problem here. My outlook addins working perfectly upto office 2010. In office 2013 almost all things are working perfectly. But of course there are some problems. The Main problem is in 2013 user can reply for mail from explore window itself.  Look at the below image.

    My question is, how can i access the email when user select the button "Send and archive". I tried the below code, but its not working.

    Outlook.Inspector inspector = this.OutlookApp.ActiveInspector();
                        if (inspector.CurrentItem is MailItem)
                        {
                            MailItem mail = (MailItem)inspector.CurrentItem;
    }

    Thanks & Regards

    Bobbin


    Tuesday, May 21, 2013 5:26 PM

Answers

  • You can of course handle the Application.ItemSend() event, which will handle any send.
     
    Normally, what you'd do is handle the Explorer.ActiveInlineResponse object on ActiveExplorer. See http://msdn.microsoft.com/en-us/library/office/jj231535.aspx. Also see the Explorer section in http://msdn.microsoft.com/en-us/library/office/ff862367.aspx to see other related properties and events.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Bobbin Paulose" <=?utf-8?B?Qm9iYmluIFBhdWxvc2U=?=> wrote in message news:376cf804-0ff0-4675-8783-40f97b241e86...

    Hi

    I've a problem here. My outlook addins working perfectly upto office 2010. In office 2013 almost all things are working perfectly. But of course there are some problems. The Main problem is in 2013 user can reply for mail from explore window itself.  Look at the below image.

    My question is, how can i access the email when user select the button "Send and archive". I tried the below code, but its not working.

    Outlook.Inspector inspector = this.OutlookApp.ActiveInspector();
                        if (inspector.CurrentItem is MailItem)
                        {
                            MailItem mail = (MailItem)inspector.CurrentItem;
    }

    Thanks & Regards

    Bobbin



    Ken Slovak MVP - Outlook
    Tuesday, May 21, 2013 7:30 PM
    Moderator
  • activeinlineresponse returns object that is being composed - so in your case it will be mailitem. And yes, PIA 2013 is needed for that object to be available at compile time, unless you want to use dynamic object. you do not have to actually install PIA, you can just grab needed dlls from other machine.
    Wednesday, May 22, 2013 10:11 AM
  • You need the PIA for Outlook 2013, which is only available when you install Office 2013 somewhere. There is no redistributable package of Office 2013 PIA's as there was for earlier versions of Office, so you need to have Office 2013 installed somewhere even if not on your development machine. Otherwise you'd need to use dynamic objects and late binding using Reflection to work with the inline response object.
     
    As far as sample code and such, there isn't much out there. See Randy's article on what's new for Outlook 2013 at http://msdn.microsoft.com/en-us/library/office/jj228679.aspx, it does have more information as well as some working code samples in the section on working with an inline response.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Bobbin Paulose" <=?utf-8?B?Qm9iYmluIFBhdWxvc2U=?=> wrote in message news:bd96883b-632b-423d-b123-5890712269e2...

    Hi

    I checked in net, i didnt find the PIA for office 2013. Or can you tell me the needed dlls?

    Thanks

    Bobbin


    Ken Slovak MVP - Outlook
    Wednesday, May 22, 2013 1:53 PM
    Moderator
  • VS 2010 knows nothing at all about Outlook or Office 2013, there are no templates for 2013 addins. That's normal.
     
    However you can still create a 2010 addin using that template and change the references from 2010 to 2013, there's nothing to stop you from doing that.
     
    For a VSTO addin you could use VS 2012, that has templates for 2010 and 2013 VSTO addin projects.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Bobbin Paulose" <=?utf-8?B?Qm9iYmluIFBhdWxvc2U=?=> wrote in message news:6912dd54-d965-44fa-8c5c-83f4ba950260...

    Hi 

    I have installed Office 2013, but i cant access this object  Explorer.ActiveInlineResponse. This " ActiveInlineResponse" is not showing in my intelligence. See the screen shot below

    When i try to create a new addin for office 2013, it also not showing, Screen shot is attached below

    Thanks

    Bobbin


    Ken Slovak MVP - Outlook
    Wednesday, May 22, 2013 5:41 PM
    Moderator

All replies

  • You can of course handle the Application.ItemSend() event, which will handle any send.
     
    Normally, what you'd do is handle the Explorer.ActiveInlineResponse object on ActiveExplorer. See http://msdn.microsoft.com/en-us/library/office/jj231535.aspx. Also see the Explorer section in http://msdn.microsoft.com/en-us/library/office/ff862367.aspx to see other related properties and events.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Bobbin Paulose" <=?utf-8?B?Qm9iYmluIFBhdWxvc2U=?=> wrote in message news:376cf804-0ff0-4675-8783-40f97b241e86...

    Hi

    I've a problem here. My outlook addins working perfectly upto office 2010. In office 2013 almost all things are working perfectly. But of course there are some problems. The Main problem is in 2013 user can reply for mail from explore window itself.  Look at the below image.

    My question is, how can i access the email when user select the button "Send and archive". I tried the below code, but its not working.

    Outlook.Inspector inspector = this.OutlookApp.ActiveInspector();
                        if (inspector.CurrentItem is MailItem)
                        {
                            MailItem mail = (MailItem)inspector.CurrentItem;
    }

    Thanks & Regards

    Bobbin



    Ken Slovak MVP - Outlook
    Tuesday, May 21, 2013 7:30 PM
    Moderator
  • Hi Ken

    Thanks for your reply....

    Can i get a working example ? For getting "ActiveInlineResponse" i need to install PIA of office 2013..? Now in my system i installed office 2010.

    Thanks


    Wednesday, May 22, 2013 9:32 AM
  • activeinlineresponse returns object that is being composed - so in your case it will be mailitem. And yes, PIA 2013 is needed for that object to be available at compile time, unless you want to use dynamic object. you do not have to actually install PIA, you can just grab needed dlls from other machine.
    Wednesday, May 22, 2013 10:11 AM
  • Hi

    I checked in net, i didnt find the PIA for office 2013. Or can you tell me the needed dlls?

    Thanks

    Bobbin

    Wednesday, May 22, 2013 10:20 AM
  • You need the PIA for Outlook 2013, which is only available when you install Office 2013 somewhere. There is no redistributable package of Office 2013 PIA's as there was for earlier versions of Office, so you need to have Office 2013 installed somewhere even if not on your development machine. Otherwise you'd need to use dynamic objects and late binding using Reflection to work with the inline response object.
     
    As far as sample code and such, there isn't much out there. See Randy's article on what's new for Outlook 2013 at http://msdn.microsoft.com/en-us/library/office/jj228679.aspx, it does have more information as well as some working code samples in the section on working with an inline response.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Bobbin Paulose" <=?utf-8?B?Qm9iYmluIFBhdWxvc2U=?=> wrote in message news:bd96883b-632b-423d-b123-5890712269e2...

    Hi

    I checked in net, i didnt find the PIA for office 2013. Or can you tell me the needed dlls?

    Thanks

    Bobbin


    Ken Slovak MVP - Outlook
    Wednesday, May 22, 2013 1:53 PM
    Moderator
  • Hi 

    I have installed Office 2013, but i cant access this object  Explorer.ActiveInlineResponse. This " ActiveInlineResponse" is not showing in my intelligence. See the screen shot below

    When i try to create a new addin for office 2013, it also not showing, Screen shot is attached below

    Thanks

    Bobbin

    Wednesday, May 22, 2013 5:23 PM
  • VS 2010 knows nothing at all about Outlook or Office 2013, there are no templates for 2013 addins. That's normal.
     
    However you can still create a 2010 addin using that template and change the references from 2010 to 2013, there's nothing to stop you from doing that.
     
    For a VSTO addin you could use VS 2012, that has templates for 2010 and 2013 VSTO addin projects.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Bobbin Paulose" <=?utf-8?B?Qm9iYmluIFBhdWxvc2U=?=> wrote in message news:6912dd54-d965-44fa-8c5c-83f4ba950260...

    Hi 

    I have installed Office 2013, but i cant access this object  Explorer.ActiveInlineResponse. This " ActiveInlineResponse" is not showing in my intelligence. See the screen shot below

    When i try to create a new addin for office 2013, it also not showing, Screen shot is attached below

    Thanks

    Bobbin


    Ken Slovak MVP - Outlook
    Wednesday, May 22, 2013 5:41 PM
    Moderator