Esempio n. 1
0
 void WordApp_DocumentBeforeSave(Word.Document document, ref bool SaveAsUI, ref bool Cancel)
 {
     WordBinder binder;
     if (!openDocuments.TryGetValue(document.DocID() ?? "", out binder)) return;
     GetItem(binder).Caption = document.Name;
     if (RibbonBinder == binder)
         wordBinderGroup.Text = document.Name;
 }
Esempio n. 2
0
        void WordApp_DocumentBeforeClose(Word.Document document, ref bool Cancel)
        {
            WordBinder binder;
            if (!openDocuments.TryGetValue(document.DocID() ?? "", out binder)) return;

            if (RibbonBinder == binder) RibbonBinder = null;

            ribbon.Items.Remove(GetItem(binder));
            openDocuments.Remove(document.DocID());
            binder.Dispose();
        }