Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have developed the VSTO addin in c# and now i want to add event to SheetChanged,SheetSelectionChanged,WorkBookActivate, WorkBookDeactivate. How can I achieve this?
Can I use the same Commandbar event to do this? Or is there any difference between the commandbars and VSTO event handlers?Please help me in this.
Posted
Updated 1-Dec-16 23:04pm

1 solution

C#
private void InternalStartup()
       {
           this.Startup += new System.EventHandler(ThisAddIn_Startup);
           this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
           this.Application.DocumentOpen += new Word.ApplicationEvents4_DocumentOpenEventHandler(Application_DocumentOpen);
           this.Application.DocumentChange += new Word.ApplicationEvents4_DocumentChangeEventHandler(Application_DocumentChange);
           this.Application.DocumentBeforeClose += new Word.ApplicationEvents4_DocumentBeforeCloseEventHandler(Application_DocumentBeforeClose);
           this.Application.DocumentBeforeSave += Application_DocumentBeforeSave;
           ((Word.ApplicationEvents4_Event)Application).NewDocument += NewDocumentEvent;
       }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900