none
How to get the instance of sent item? RRS feed

  • Question

  • Hi all,

    I need to save the sent item to local file system after a new mail item sent out. I wrote an adjoin form region,  attached the Application.ItemSend event, and in the event handler, I get the instance of current mail item and saved it to local. However, when I open the saved item, it appears in the "Edit" mode. The customer has a strong requirment that the sent item should be in non-edit mode.

    Later on I found the ItemSend event fires before the mail item actually being sent. That's why the saved mail item is always in the "Edit" mode.

    I searched on the internet and found only 1 solution: listen to the sent items folder. However, it's complicated if the user has multiple .pst file.

    I wonder if there's any API can change the mail item to "Sent" status? Any clue would be apprieciate. Thanks!

    Thursday, February 23, 2012 9:11 AM

Answers

  • No, you have to listen for ItemAdd on Items object on whatever folder mail will be stored into after save (and please notice following 2 exceptions: mail can be configured to be stored in different folder after sending, so you have to check that in ItemSend event and also use can configure outlook to _not_ store at all sent mails).
    • Marked as answer by Malone Ma Friday, February 24, 2012 2:33 AM
    • Unmarked as answer by Malone Ma Friday, February 24, 2012 2:34 AM
    • Marked as answer by Malone Ma Friday, February 24, 2012 2:36 AM
    Thursday, February 23, 2012 9:19 AM
  • I resolved this issue by using

    OpenSharedItem

    to open the mail item. And it displays in non-edit mode.

    • Marked as answer by Malone Ma Friday, February 24, 2012 2:36 AM
    Friday, February 24, 2012 2:36 AM

All replies

  • No, you have to listen for ItemAdd on Items object on whatever folder mail will be stored into after save (and please notice following 2 exceptions: mail can be configured to be stored in different folder after sending, so you have to check that in ItemSend event and also use can configure outlook to _not_ store at all sent mails).
    • Marked as answer by Malone Ma Friday, February 24, 2012 2:33 AM
    • Unmarked as answer by Malone Ma Friday, February 24, 2012 2:34 AM
    • Marked as answer by Malone Ma Friday, February 24, 2012 2:36 AM
    Thursday, February 23, 2012 9:19 AM
  • Hi Amian,

    Although I get the instance of mail item from sent items folder, it is still in "Edit" mode... Any clue?

    Thursday, February 23, 2012 10:33 AM
  • If you open that mail from UI in sent items folder - is it also in Edit mode?
    Thursday, February 23, 2012 1:31 PM
  • I resolved this issue by using

    OpenSharedItem

    to open the mail item. And it displays in non-edit mode.

    • Marked as answer by Malone Ma Friday, February 24, 2012 2:36 AM
    Friday, February 24, 2012 2:36 AM