D
David Thielen
Hi;
We have a problem where Word stops calling our menu event handlers after
awhile. The most common case where it happens is we open document 1, then
open document 2, then close document 1.
Our AddIn is still loaded and the DoubleClick handler still works as do the
Open/Close/etc events. But the menu events are gone.
The menu objects I get from Word are stored in an object that is created in
my Connect.cs class:
public class Connect : Object, IDTExtensibility2, IDisposable,
IRibbonExtensibility
So it is in the Connect object. This object lasts the lifetime of the AddIn
- correct? So the member object that contains the menu object will still
exist after a document is closed - correct?
I create the menus using:
private readonly CommandBarPopup[] popupMenus = new CommandBarPopup[5];
private readonly CommandBarControl[] buttonMenus = new CommandBarControl[26];
....
buttonMenus[ind] =
popupMenus[mainInd].Controls.Add(MsoControlType.msoControlButton,
Type.Missing, Type.Missing, Type.Missing, false);
buttonMenus[ind].Caption = buttonOn.caption;
buttonMenus[ind].TooltipText = buttonOn.tooltip;
buttonMenus[ind].Tag = buttonOn.tag;
buttonMenus[ind].Visible = true;
buttonMenus[ind].BeginGroup = buttonOn.beginGroup;
if (buttonOn.handler != null)
((CommandBarButton)buttonMenus[ind]).Click += buttonOn.handler;
What are my menu event handlers suddenly not being called?
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
We have a problem where Word stops calling our menu event handlers after
awhile. The most common case where it happens is we open document 1, then
open document 2, then close document 1.
Our AddIn is still loaded and the DoubleClick handler still works as do the
Open/Close/etc events. But the menu events are gone.
The menu objects I get from Word are stored in an object that is created in
my Connect.cs class:
public class Connect : Object, IDTExtensibility2, IDisposable,
IRibbonExtensibility
So it is in the Connect object. This object lasts the lifetime of the AddIn
- correct? So the member object that contains the menu object will still
exist after a document is closed - correct?
I create the menus using:
private readonly CommandBarPopup[] popupMenus = new CommandBarPopup[5];
private readonly CommandBarControl[] buttonMenus = new CommandBarControl[26];
....
buttonMenus[ind] =
popupMenus[mainInd].Controls.Add(MsoControlType.msoControlButton,
Type.Missing, Type.Missing, Type.Missing, false);
buttonMenus[ind].Caption = buttonOn.caption;
buttonMenus[ind].TooltipText = buttonOn.tooltip;
buttonMenus[ind].Tag = buttonOn.tag;
buttonMenus[ind].Visible = true;
buttonMenus[ind].BeginGroup = buttonOn.beginGroup;
if (buttonOn.handler != null)
((CommandBarButton)buttonMenus[ind]).Click += buttonOn.handler;
What are my menu event handlers suddenly not being called?
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm