Hi from few days I'm fighting with BeforeClose Event. Problem is when I'm opening more documents. For example: I'm opening 4 new documents, every single document in NewDocument Event attache BeforeClose Event to Document like that :
var vstoDoc = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
vstoDoc.BeforeClose += new System.ComponentModel.CancelEventHandler(ThisDocument_BeforeClose);
Now I'm trying to close it so I'm closing Doc4 after Doc2 and now is problem because Doc1 still have BeforeClose Event but Doc3 not. So if I close Documents descending starting from last it's work fine. But if I close for example Doc1 as first the rest don't have BeforeClose Event. I don't have idea what's happening.