D
David
I'm trying to add a menu item to MS Word under "File -> Send To." I've
written some code in C# from the code generated by the .NET 2003 Add-in
wizard.
My class uses the IDTExtensibility2 interface.
I've successfully created a menu bar item under the Send To popup of the
File menu bar. When I uninstall the add-in, the menu bar stays and does
nothing, which is not desirable. I would like to remove the menu item when
the add-in is uninstalled. I figured the way to do this would be to delete
the menu item when MS Word shuts down - that way it must be reloaded, so if
there is no add-in, there is no menu item.
I've tried many different ways of deleting the menu item, but either I
receive an unhandled COMException HRESULT=0x800A01A8 when attempting to
delete it. I've tried deleting in OnBeginShutdown(), OnDisconnection() and
as an event handler to ApplicationEvents#_Event_Quit (where #=2,3). Nothing
has worked.
I think the problem is that any changes made at this point are not persisted
by Word. If I add a menu item, or change a property during shutdown, those
changes do not make it in.
If anybody has any ideas, I would greatly appreciate them.
Thanks,
David
written some code in C# from the code generated by the .NET 2003 Add-in
wizard.
My class uses the IDTExtensibility2 interface.
I've successfully created a menu bar item under the Send To popup of the
File menu bar. When I uninstall the add-in, the menu bar stays and does
nothing, which is not desirable. I would like to remove the menu item when
the add-in is uninstalled. I figured the way to do this would be to delete
the menu item when MS Word shuts down - that way it must be reloaded, so if
there is no add-in, there is no menu item.
I've tried many different ways of deleting the menu item, but either I
receive an unhandled COMException HRESULT=0x800A01A8 when attempting to
delete it. I've tried deleting in OnBeginShutdown(), OnDisconnection() and
as an event handler to ApplicationEvents#_Event_Quit (where #=2,3). Nothing
has worked.
I think the problem is that any changes made at this point are not persisted
by Word. If I add a menu item, or change a property during shutdown, those
changes do not make it in.
If anybody has any ideas, I would greatly appreciate them.
Thanks,
David