none
find source mail whose reply have been clicked RRS feed

  • Question

  • Hi All,

    I am using vsto 4 with VS2010 and developing the addin for office2010 outlook.

    In addin when user clicks reply to any mailitem and the inspector is opening then i have to identify the source mail whose reply have been clicked. I had tried from OutlookSpy but dont find a way for that.

    Please help.

     


    Anand
    Thursday, February 2, 2012 11:53 AM

Answers

  • Outlook knows the source item because it creates the reply.

    The reply however does not link back to the source item in any way.

    You can try to use the conversation index (see http://msdn.microsoft.com/en-us/library/cc765583.aspx) - remove the last 5 bytes from the reply's conversation index and then try to find a message with the (truncated) conversation index. But then you would need to know the folder the original item resides.

     


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.2 is now available!
    Friday, February 3, 2012 8:34 PM

All replies

  •  

    Application.ActiveExplorer.Selection will give you the currently selected messages.

    You can also look at the Application.Inspectors collection  in case it was a reply to an e-mail displayed by an inspector.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.2 is now available!
    Thursday, February 2, 2012 2:53 PM
  • Thanks Dimitry for your response but my issue is more complicated. We are having customized form region for our mailitem. When user is selecting that mailitem, its showing our form region on preview pane which is having the OutlookViewControl to show the corresponding mailitems like one mailitem is for product and if its selected, customized form region is showing the mailitem which are orders for that product in outlookviewcontrol. User can select the mail item and it will show the corresponding mailitems in customized form region in outlookviewcontrol and user can select them and from there either by right click, explorer or by short cut can reply on that mail item which is selected in customized form region under outlookviewcontrol. If i try to find the activeexplorer.selection its giving the actual mailitem which is selected in explorer but not one which is replied from outlookviewcontrol in customized form region.

    Outlook is able identify the source mailitem in reply and after reply its setting the reply flag so it must be maintained somewhere in mailitem. But i had checked most of the mailitem properties from outlookSpy but dont find it. Find one property parententryid but its maintained for folder not the mailitem.

    In my scenario, i have to find the source mailitem from opened reply mailitem.


    Anand
    Friday, February 3, 2012 5:24 AM
  • Outlook knows the source item because it creates the reply.

    The reply however does not link back to the source item in any way.

    You can try to use the conversation index (see http://msdn.microsoft.com/en-us/library/cc765583.aspx) - remove the last 5 bytes from the reply's conversation index and then try to find a message with the (truncated) conversation index. But then you would need to know the folder the original item resides.

     


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.2 is now available!
    Friday, February 3, 2012 8:34 PM