none
Display email message in task pane just by selecting/clicking the mail(no double clicking) RRS feed

  • Question

  • I am new to outlook development and i was trying to create a custom task pane which displays email messages just by clicking/selecting them. Outlook also does this but i wanted to implement this in my own.

    Please help me guys. I thought that outlook.selection or active explorer would help but can't find anything use full on net.

     

    I am using Visual  Studio Professional 2010 and Outlook 2007.

     

    Thanks in advance.

    Thursday, August 4, 2011 11:21 AM

Answers

  • You will need to subscribe to the SelectionChange() event for the ActiveExplorer() object. Take the Selection collection that's handed to you in that event handler and check it out. If Selection.Count is 1 you can then get that item and display whatever you want from it in your task pane. Of course you'd need to read the properties you want yourself, there's no DisplayInTaskPane method.
     
    I would also handle the BeforeFolderSwitch() event and see what type of folder is being switched to when that fires. You may want to not handle selection changes if the folder is a contacts folder for example. You can use Folder.DefaultItemType to check what type of folder it is. That returns a member of the OlItemType enum.
     
    Finally, as a folder such as Inbox can hold non-email items such as meeting and task requests and so on, you might want to check that the item in Selection is a mail item. To do that you can check the Class of the item to see that it's OlObjectClass.olMail.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "abhishekismad" <=?utf-8?B?YWJoaXNoZWtpc21hZA==?=> wrote in message news:7d187196-e02e-454c-bd61-1a46b231bcc4...

    I am new to outlook development and i was trying to create a custom task pane which displays email messages just by clicking/selecting them. Outlook also does this but i wanted to implement this in my own.

    Please help me guys. I thought that outlook.selection or active explorer would help but can't find anything use full on net.

     

    I am using Visual  Studio Professional 2010 and Outlook 2007.

     

    Thanks in advance.


    Ken Slovak MVP - Outlook
    • Marked as answer by abhishekismad Friday, August 5, 2011 6:25 AM
    Thursday, August 4, 2011 1:09 PM

All replies

  • You will need to subscribe to the SelectionChange() event for the ActiveExplorer() object. Take the Selection collection that's handed to you in that event handler and check it out. If Selection.Count is 1 you can then get that item and display whatever you want from it in your task pane. Of course you'd need to read the properties you want yourself, there's no DisplayInTaskPane method.
     
    I would also handle the BeforeFolderSwitch() event and see what type of folder is being switched to when that fires. You may want to not handle selection changes if the folder is a contacts folder for example. You can use Folder.DefaultItemType to check what type of folder it is. That returns a member of the OlItemType enum.
     
    Finally, as a folder such as Inbox can hold non-email items such as meeting and task requests and so on, you might want to check that the item in Selection is a mail item. To do that you can check the Class of the item to see that it's OlObjectClass.olMail.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "abhishekismad" <=?utf-8?B?YWJoaXNoZWtpc21hZA==?=> wrote in message news:7d187196-e02e-454c-bd61-1a46b231bcc4...

    I am new to outlook development and i was trying to create a custom task pane which displays email messages just by clicking/selecting them. Outlook also does this but i wanted to implement this in my own.

    Please help me guys. I thought that outlook.selection or active explorer would help but can't find anything use full on net.

     

    I am using Visual  Studio Professional 2010 and Outlook 2007.

     

    Thanks in advance.


    Ken Slovak MVP - Outlook
    • Marked as answer by abhishekismad Friday, August 5, 2011 6:25 AM
    Thursday, August 4, 2011 1:09 PM
  • Dear Slovak

     

    Your reply was extremely helpful. Thanks.

    Friday, August 5, 2011 7:29 AM