K
KarthikRamz
Hi,
I have a word add-in written in VS 2005 using the Shared Add-in project.
Through the add-in I am placing a simple button on the standard toolbar. The
button shows up on the standard toolbar appropriately.
Now when I uninstall the add-in, the button does not get removed.
I am creating the button object in the OnStartUpComplete event handler as
follows:
object omissing = System.Reflection.Missing.Value;
MyButton =
(CommandBarButton)oStandardBar.Controls.Add(1, omissing, omissing, omissing,
true);
MyButton.Caption = "My button";
MyButton.Style = MsoButtonStyle.msoButtonCaption;
And I am disposing the button object in the OnBeginShutDown event handler as
follows:
object omissing = System.Reflection.Missing.Value;
MyButton.Delete(omissing);
MyButton = null;
((WORD.Application)applicationObject).NormalTemplate.Save(); //
I came through some posting which suggested adding this line, but it did not
help.
The button does not get deleted. Am I missing some thing here?
Thanks!
Karthik
I have a word add-in written in VS 2005 using the Shared Add-in project.
Through the add-in I am placing a simple button on the standard toolbar. The
button shows up on the standard toolbar appropriately.
Now when I uninstall the add-in, the button does not get removed.
I am creating the button object in the OnStartUpComplete event handler as
follows:
object omissing = System.Reflection.Missing.Value;
MyButton =
(CommandBarButton)oStandardBar.Controls.Add(1, omissing, omissing, omissing,
true);
MyButton.Caption = "My button";
MyButton.Style = MsoButtonStyle.msoButtonCaption;
And I am disposing the button object in the OnBeginShutDown event handler as
follows:
object omissing = System.Reflection.Missing.Value;
MyButton.Delete(omissing);
MyButton = null;
((WORD.Application)applicationObject).NormalTemplate.Save(); //
I came through some posting which suggested adding this line, but it did not
help.
The button does not get deleted. Am I missing some thing here?
Thanks!
Karthik