ActiveDocument.ContentControlOnExit doesn't work


Joined
Dec 11, 2018
Messages
3
Reaction score
0
after i operation word's contentcontrol(like refill the control contents),this event will not work,please help,thank you very much
 
Ad

Advertisements

Joined
Dec 11, 2018
Messages
3
Reaction score
0
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("控件失去焦点");
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top