T
Tim Pulley
I'm using VS 2K5, C#, VSTO SE and Outlook 2K7. I've created an Item event
handler class and hooked it up to the following events: AttachmentAdd, Save,
PropertyChange, Close and Unload. All the events fire as expected except
Unload. I've searched but I haven't found any info about a problem with this
event. I don't think I'm doing anything wrong but here's the code to hook the
Unload event just in case.
public class OLItemEventsHandler
{
protected Object m_oOLItem;
protected Outlook.ItemEvents_10_Event m_ItemEvents;
protected Outlook.ItemEvents_10_UnloadEventHandler
m_ItemEventsHandler_Unload;
public OLItemEventsHandler(object oOLItem)
{
m_oOLItem = oOLItem;
m_ItemEvents = (Outlook.ItemEvents_10_Event) oOLItem;
m_ItemEventsHandler_Unload = new
Microsoft.Office.Interop.Outlook.ItemEvents_10_UnloadEventHandler(itemEvent_Unload);
m_ItemEvents.Unload += m_ItemEventsHandler_Unload;
}
protected void itemEvent_Unload()
{
Trace.WriteLine("Item Unload Event Fired");
}
}
handler class and hooked it up to the following events: AttachmentAdd, Save,
PropertyChange, Close and Unload. All the events fire as expected except
Unload. I've searched but I haven't found any info about a problem with this
event. I don't think I'm doing anything wrong but here's the code to hook the
Unload event just in case.
public class OLItemEventsHandler
{
protected Object m_oOLItem;
protected Outlook.ItemEvents_10_Event m_ItemEvents;
protected Outlook.ItemEvents_10_UnloadEventHandler
m_ItemEventsHandler_Unload;
public OLItemEventsHandler(object oOLItem)
{
m_oOLItem = oOLItem;
m_ItemEvents = (Outlook.ItemEvents_10_Event) oOLItem;
m_ItemEventsHandler_Unload = new
Microsoft.Office.Interop.Outlook.ItemEvents_10_UnloadEventHandler(itemEvent_Unload);
m_ItemEvents.Unload += m_ItemEventsHandler_Unload;
}
protected void itemEvent_Unload()
{
Trace.WriteLine("Item Unload Event Fired");
}
}