示例#1
0
        //Create callback methods here. For more information about adding callback methods, visit https://go.microsoft.com/fwlink/?LinkID=271226

        public void RibbonLoad(Office.IRibbonUI ribbonUI)
        {
            this.ribbon = ribbonUI;
            //register events
            Application          = Globals.ThisAddIn.Application;
            SelectionChangeEvent = new Microsoft.Office.Interop.Word.ApplicationEvents4_WindowSelectionChangeEventHandler(Application_WindowSelectionChange);
            Application.WindowSelectionChange += SelectionChangeEvent;
            DocumentChangeEvent         = new Microsoft.Office.Interop.Word.ApplicationEvents4_DocumentChangeEventHandler(Application_DocumentChange);
            Application.DocumentChange += DocumentChangeEvent;
        }
示例#2
0
        public void Ribbon_Load(Office.IRibbonUI ribbonUI)
        {
            //hold a handle to the ribbon so we can refresh controls later
            this.Ribbon = ribbonUI;

            //register events
            Application          = Globals.ThisAddIn.Application;
            SelectionChangeEvent = new Microsoft.Office.Interop.Word.ApplicationEvents4_WindowSelectionChangeEventHandler(Application_WindowSelectionChange);
            Application.WindowSelectionChange += SelectionChangeEvent;
            DocumentChangeEvent         = new Microsoft.Office.Interop.Word.ApplicationEvents4_DocumentChangeEventHandler(Application_DocumentChange);
            Application.DocumentChange += DocumentChangeEvent;
        }