none
Outlook Addin Existing Inspectors open event RRS feed

  • Question

  • With reference to Developing an Inspector Wrapper for Outlook 2010: http://msdn.microsoft.com/en-us/library/office/ff973716.aspx

    Under the section "How to use this framework", the code sample tries to handle existing inspectors (i.e double clicking a .msg file). However this does not allow the MailItem open event to fire.

    For example, I have an addin for outlook that will create a toolbar for mail items. The toolbar is created correctly whenever a mail item is opened through Outlook (i.e outlook is already opened).However if outlook is closed and I double click on a .msg file, the Outlook addin will enter the code that handles existing inspectors:

    (i.e //  Also handle existing Inspectors (for example, double-clicking a .msg file).

    foreach (Outlook.Inspector inspector in _inspectors) 
    {
         WrapInspector(inspector);
    }

    This will wrap the inspector, but this does not fire the Item.Open event when the MailItemWrapper is intialised and therefore doesn't create the tool bar that is created on the Item.Open event.

    Is there a way to get the item.open event to fire for existing inspectors?
    Friday, September 28, 2012 7:56 AM

Answers

  • Not possible. Set a public flag in the wrapper class that gets checked when the class is initialized and use that flag to determine whether or not to create your UI.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "c_t70" <=?utf-8?B?Y190NzA=?=> wrote in message news:fb12fae8-ab5a-4179-b9d1-2cc9c34de688...

    With reference to Developing an Inspector Wrapper for Outlook 2010: http://msdn.microsoft.com/en-us/library/office/ff973716.aspx

    Under the section "How to use this framework", the code sample tries to handle existing inspectors (i.e double clicking a .msg file). However this does not allow the MailItem open event to fire.

    For example, I have an addin for outlook that will create a toolbar for mail items. The toolbar is created correctly whenever a mail item is opened through Outlook (i.e outlook is already opened).However if outlook is closed and I double click on a .msg file, the Outlook addin will enter the code that handles existing inspectors:

    (i.e //  Also handle existing Inspectors (for example, double-clicking a .msg file).

    foreach (Outlook.Inspector inspector in _inspectors) 
    {
         WrapInspector(inspector);
    }

    This will wrap the inspector, but this does not fire the Item.Open event when the MailItemWrapper is intialised and therefore doesn't create the tool bar that is created on the Item.Open event.

    Is there a way to get the item.open event to fire for existing inspectors?

    Ken Slovak MVP - Outlook
    Friday, September 28, 2012 3:07 PM
    Moderator