T
Tim Pulley
I've found what I believe is a bug in Outlook. I can demonstrate the problem
with the following code. It's a small add-in that hooks an event on the
Application
object. The problem only happens when the add-in is installed.
I've don't see anything wrong with this code. If anyone sees a problem
please let me know.
TIA, Tim
public partial class ThisAddIn
{
private void ThisAddIn_Startup( object sender, System.EventArgs e )
{
try
{
m_application = Globals.ThisAddIn.Application;
( (Outlook.ApplicationEvents_11_Event)
m_application ).OptionsPagesAdd += new
Outlook.ApplicationEvents_11_OptionsPagesAddEventHandler(
onEvent_OptionsPagesAdd );
}
catch( Exception X )
{
}
}
private void ThisAddIn_Shutdown( object sender, System.EventArgs e )
{
try
{
( (Outlook.ApplicationEvents_11_Event)
m_application ).OptionsPagesAdd -= new
Outlook.ApplicationEvents_11_OptionsPagesAddEventHandler(
onEvent_OptionsPagesAdd );
m_application = null;
}
catch( Exception X )
{
}
finally
{
}
}
private void onEvent_OptionsPagesAdd( Outlook.PropertyPages
PropertyPages )
{
return;
}
//
Outlook.Application m_application;
#region VSTO generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup( )
{
this.Startup += new System.EventHandler( ThisAddIn_Startup );
this.Shutdown += new System.EventHandler( ThisAddIn_Shutdown );
}
#endregion
}
with the following code. It's a small add-in that hooks an event on the
Application
object. The problem only happens when the add-in is installed.
I've don't see anything wrong with this code. If anyone sees a problem
please let me know.
TIA, Tim
public partial class ThisAddIn
{
private void ThisAddIn_Startup( object sender, System.EventArgs e )
{
try
{
m_application = Globals.ThisAddIn.Application;
( (Outlook.ApplicationEvents_11_Event)
m_application ).OptionsPagesAdd += new
Outlook.ApplicationEvents_11_OptionsPagesAddEventHandler(
onEvent_OptionsPagesAdd );
}
catch( Exception X )
{
}
}
private void ThisAddIn_Shutdown( object sender, System.EventArgs e )
{
try
{
( (Outlook.ApplicationEvents_11_Event)
m_application ).OptionsPagesAdd -= new
Outlook.ApplicationEvents_11_OptionsPagesAddEventHandler(
onEvent_OptionsPagesAdd );
m_application = null;
}
catch( Exception X )
{
}
finally
{
}
}
private void onEvent_OptionsPagesAdd( Outlook.PropertyPages
PropertyPages )
{
return;
}
//
Outlook.Application m_application;
#region VSTO generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup( )
{
this.Startup += new System.EventHandler( ThisAddIn_Startup );
this.Shutdown += new System.EventHandler( ThisAddIn_Shutdown );
}
#endregion
}