P
Petrowi
I have an app that traps several events in Word (C#). The problem is that
some of the events are fired and processed properly (WindowBeforeRightClick,
WindowBeforeDoubleClick), but WindowSelectionChange isn't firing at all.
All the event listeners are attached at the same spot in the code, all at
the same time. There aren't any other occurances of WindowSelectionChange use
in the whole solution, so I don't see how the event handler could have been
cleared.
The project is large enough that I'm missing something (~300KLoC), there are
also templates involved, but I looked at them and there is nothing about
these events in particular. The template handles toolbar clicks, menu item
clicks and DocumentChange event.
I'm out of ideas what could be preventing the SelectionChange event from
firing, any suggestions?
wap.DocumentBeforeSave += new
Word.ApplicationEvents4_DocumentBeforeSaveEventHandler(wap_DocumentBeforeSave);
wap.WindowBeforeRightClick += new
Word.ApplicationEvents4_WindowBeforeRightClickEventHandler(wap_WindowBeforeRightClick);
wap.WindowBeforeDoubleClick += new
Word.ApplicationEvents4_WindowBeforeDoubleClickEventHandler(wap_WindowBeforeDoubleClick);
wap.WindowSelectionChange += new
Word.ApplicationEvents4_WindowSelectionChangeEventHandler(wap_WindowSelectionChange);
some of the events are fired and processed properly (WindowBeforeRightClick,
WindowBeforeDoubleClick), but WindowSelectionChange isn't firing at all.
All the event listeners are attached at the same spot in the code, all at
the same time. There aren't any other occurances of WindowSelectionChange use
in the whole solution, so I don't see how the event handler could have been
cleared.
The project is large enough that I'm missing something (~300KLoC), there are
also templates involved, but I looked at them and there is nothing about
these events in particular. The template handles toolbar clicks, menu item
clicks and DocumentChange event.
I'm out of ideas what could be preventing the SelectionChange event from
firing, any suggestions?
wap.DocumentBeforeSave += new
Word.ApplicationEvents4_DocumentBeforeSaveEventHandler(wap_DocumentBeforeSave);
wap.WindowBeforeRightClick += new
Word.ApplicationEvents4_WindowBeforeRightClickEventHandler(wap_WindowBeforeRightClick);
wap.WindowBeforeDoubleClick += new
Word.ApplicationEvents4_WindowBeforeDoubleClickEventHandler(wap_WindowBeforeDoubleClick);
wap.WindowSelectionChange += new
Word.ApplicationEvents4_WindowSelectionChangeEventHandler(wap_WindowSelectionChange);