NewInspector is not a good event in which to create CommandBar UI. Depending
on the Outlook version and whether it's a WordMail object or not the
CommandBars collection of the Inspector may or may not be completely
instantiated in that event handler. In Outlook 2007 you explicitly get a
weak object reference to Inspector in NewInspector, in which many properties
of the Inspector or Inspector.CurrentItem aren't fully exposed to you yet.
I always create any UI for an Inspector in the first Inspector.Activate()
event that fires. At that time all UI elements are fully instantiated and
exposed to you.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
wrote in message
...
Hi,
In was trying to add button in inspector window. I
used
.InspectorsEvents_NewInspectorEventHandler(myInspe ctors_NewInspector);
event and in this event I called a wrapper class where I configured
ItemEvents_10_OpenEventHandler(myMailItem_Open);
In this event I tried to create a button.
The problem over here is the button does not get created. However,
when I click on reply to this mail a new inspector is opened up where
I can reply to my mail and then a button on the reading inspector is
added.
I do not understand why this is happening.