K
Kenneth
Hi,
I am writing an add in for Outlook 2003 with VS.NET 2003 in C#. The add in
creates a new command bar button. it installs and runs fine but the button
respawns every time outlook is opened so that after opening outlook 4 times
you have four copies of the button. It also does not remove the button when
you uninstall the add in. here is what I am doing:
OnStartupComplete(ref System.Array custom){
CommandBars = ApplicationObject.ActiveExplorer().CommandBars;
try{
myButton = (CommandBarsButton) commandBars["Standard"].Control("task");
}
catch(e){
myButton = (CommandBarsButton)commandBar"Standard"].Add
(1,System.Reflection.Missing.Value,System.Reflection.Missing.Value,System.Reflection.Missing.Value,System.Reflection.Missing.Value);
myButton.Caption = "task";
myButton.Style = MsoButtonStyle.msoButtonCaption;
}
myButton.Tag = "task";
myButton.Visible = true;
}
OnBeginShutdown(ref System.Array custom){
myButton.Delete(System.Reflection.Missing.Value);
GC.Collect();
}
onDisConnection("you know whats here"){
if(disconnectMode !=
Extensibility.ext_DisconnectMode.ext_dm_HoatShutdown){
OnBeginShutdown(ref custom);
}
myButton.Delete(System.Reflection.Missing.Value);
GC.Collect();
}
why is my button not deleted when i close outlook or remove the addin?
I am writing an add in for Outlook 2003 with VS.NET 2003 in C#. The add in
creates a new command bar button. it installs and runs fine but the button
respawns every time outlook is opened so that after opening outlook 4 times
you have four copies of the button. It also does not remove the button when
you uninstall the add in. here is what I am doing:
OnStartupComplete(ref System.Array custom){
CommandBars = ApplicationObject.ActiveExplorer().CommandBars;
try{
myButton = (CommandBarsButton) commandBars["Standard"].Control("task");
}
catch(e){
myButton = (CommandBarsButton)commandBar"Standard"].Add
(1,System.Reflection.Missing.Value,System.Reflection.Missing.Value,System.Reflection.Missing.Value,System.Reflection.Missing.Value);
myButton.Caption = "task";
myButton.Style = MsoButtonStyle.msoButtonCaption;
}
myButton.Tag = "task";
myButton.Visible = true;
}
OnBeginShutdown(ref System.Array custom){
myButton.Delete(System.Reflection.Missing.Value);
GC.Collect();
}
onDisConnection("you know whats here"){
if(disconnectMode !=
Extensibility.ext_DisconnectMode.ext_dm_HoatShutdown){
OnBeginShutdown(ref custom);
}
myButton.Delete(System.Reflection.Missing.Value);
GC.Collect();
}
why is my button not deleted when i close outlook or remove the addin?