thanks for the reply.my code as below,it's word addin,use vs2010,office2010. when i open to existing documents ,just called A and B.well this time this ContentControlOnExit goes well.After i closed the document A,ContentControlOnExit event will not work in document B
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
Globals.ThisAddIn.Application.DocumentOpen +=new ApplicationEvents4_DocumentOpenEventHandler(Application_DocumentOpen);
}
void Application_DocumentOpen(Document doc)
{
Globals.ThisAddIn.Application.ActiveDocument.ContentControlOnExit += new DocumentEvents2_ContentControlOnExitEventHandler(ActiveDocument_ContentControlOnExit);
}
void ActiveDocument_ContentControlOnExit(Microsoft.Office.Interop.Word.ContentControl currContentControl, ref bool Cancel)
{
MessageBox.Show("控件失去焦点");
}