Reputation: 11
We have a third pary Word add-in that is closing word when any documents are closed.
This is forcing users to open Word again which takes a long time with the number of add-ins running.
I am hoping to prevent the application quit event from within our in house add-in.
A subscription has been made to the application quit event but I don't know where to go from here.
((Word.ApplicationEvents4_Event)this.Application).Quit += Application_Quit;
void Application_Quit()
{
//Prevent Word from closing here
}
Is it even possible to stop the event from running, if so how do I go about it?
Upvotes: 1
Views: 713
Reputation: 49395
You can disabled the problematic add-in from the Add-ins list.
The Word object model doesn't provide anything for that. The Quit event doesn't allow to stop the action. Only the DocumentBeforeClose event allows to cancel the action setting the Cancel parameter to true.
That's why I'd suggest contacting the add-in developer to change the code. I don't think that is the right idea to close the host application from the add-in.
Upvotes: 1