none
Get MailItem Properties when Reading in "Dashboard" RRS feed

  • Question

  • Hi guys,

    I am facing an error which gives me headaches for hours now. So I was hoping someone here could maybe help me.

    I am writing an outlook 2010 add-in. When I Open Outlook I can see the open folder an the emails in it. When I double click one of the items in the list, my "newInspector" logic runs fine, but when i just select the Mail in the list, I want my code to be executed as well. But I can't get this to work.

    In the Add-In Startup i add the following listener:

      Application.ItemLoad += Application_ItemLoad;

    and in this function I am doing something like this:

    void Application_ItemLoad(object Item)
            {
                MailItem item = (Item as MailItem);
    
                ((ItemEvents_10_Event)item).ReadComplete += ThisAddIn_ReadComplete;
            }

    I was hoping that I can somehow get the Item which is actually selected in the folder in this function, but I don't get this done.

    Can someone help me out here?

    Thanks in advance

    best regards

    Alex

    Friday, November 21, 2014 6:35 PM

Answers

  • Hello Alex,

    It seems you are interested in the SelectionChange event of the Explorer class. It is fired when the user selects a different or additional Microsoft Outlook item programmatically or by interacting with the user interface. This event also occurs when the user (either programmatically or via the user interface) clicks or switches to a different folder that contains items, because Outlook automatically selects the first item in that folder. However, this event does not occur if the folder is a file-system folder or if any folder with a current Web view is displayed.

    • Marked as answer by alymcgeel1 Saturday, November 22, 2014 4:10 PM
    Friday, November 21, 2014 6:40 PM

All replies

  • Hello Alex,

    It seems you are interested in the SelectionChange event of the Explorer class. It is fired when the user selects a different or additional Microsoft Outlook item programmatically or by interacting with the user interface. This event also occurs when the user (either programmatically or via the user interface) clicks or switches to a different folder that contains items, because Outlook automatically selects the first item in that folder. However, this event does not occur if the folder is a file-system folder or if any folder with a current Web view is displayed.

    • Marked as answer by alymcgeel1 Saturday, November 22, 2014 4:10 PM
    Friday, November 21, 2014 6:40 PM
  • Hi Eugene!

    Thank you. That was exactly what i was looking for! Works like a charm.

    best regards

    Alex

    Saturday, November 22, 2014 4:10 PM