Пример #1
0
        private void axFramerControl1_OnDocumentOpened(object sender, AxDSOFramer._DFramerCtlEvents_OnDocumentOpenedEvent e)
        {
            Document document = e.document as Document;
            document.ActiveWindow.DisplayRulers = false;
            document.ActiveWindow.DisplayRightRuler = false;
            document.ActiveWindow.DisplayVerticalRuler = false;
            document.ActiveWindow.DisplayScreenTips = false;
            document.Application.DisplayAlerts = WdAlertLevel.wdAlertsNone;
            document.ActiveWindow.View.ShowBookmarks = true;
            document.ActiveWindow.ActivePane.DisplayRulers = false;
            document.ActiveWindow.View.DisplaySmartTags = false;

            //disable word commandbars
            try
            {
                //test debug.write
                /*Debug.Listeners.Add(new TextWriterTraceListener(Console.Out));
                Debug.AutoFlush = true;
                Debug.Indent();
                Debug.WriteLine(Name.ToString());
                Debug.Unindent();*/

                Document wordDoc = document as Document;

                //Disable Text popup menu(while right click on the word client area).
                //Index is 78, in word 2003.
                //Name=Text Index=78 Type=msoBarTypePopup
                //The reason disable this first is when word started, we right click word
                //client area at once, the text popup menu perhaps still enable at this moment.
                wordDoc.CommandBars[78].Enabled = false;
                wordDoc.CommandBars[78].Visible = false;

                //this course cost a few time, disable all tool bars, menu bars.
                for (int i = 1; i <= wordDoc.CommandBars.Count; i++)
                {
                    wordDoc.CommandBars[i].Enabled = false;
                    wordDoc.CommandBars[i].Visible = false;
                }
            }
            catch (Exception)
            {
            }
        }
Пример #2
0
        ////void axFramerControl1_BeforeDocumentSaved(object sender, AxDSOFramer._DFramerCtlEvents_BeforeDocumentSavedEvent e)
        ////{
        ////}
        ////void axFramerControl1_BeforeDocumentClosed(object sender, AxDSOFramer._DFramerCtlEvents_BeforeDocumentClosedEvent e)
        ////{
        ////    //(e.document as Word.Document).Application.DocumentChange -= new Microsoft.Office.Interop.Word.ApplicationEvents4_DocumentChangeEventHandler(Application_DocumentChange);
        ////}
        void axFramerControl1_OnFileCommand(object sender, AxDSOFramer._DFramerCtlEvents_OnFileCommandEvent e)
        {
            switch (e.item)
            {
                case DSOFramer.dsoFileCommandType.dsoFileNew:
                    e.cancel = true;
                    FileNew();
                    break;
                case DSOFramer.dsoFileCommandType.dsoFileOpen:
                    e.cancel = true;
                    FileOpen();
                    break;
                case DSOFramer.dsoFileCommandType.dsoFileClose:
                    e.cancel = true;
                    FileClose();
                    break;
                case DSOFramer.dsoFileCommandType.dsoFileSave:
                    e.cancel = true;

                    FileSave();
                    break;
                case DSOFramer.dsoFileCommandType.dsoFileSaveAs:
                    e.cancel = true;
                    // FileSaveAs();
                    break;
            }
        }
Пример #3
0
 private void framerControl_OnSaveCompleted(object sender, AxDSOFramer._DFramerCtlEvents_OnSaveCompletedEvent e)
 {
     _docPath = e.fullFileLocation;
     Changed = true;
 }
Пример #4
0
 void axFramerControl1_OnDocumentOpened(object sender, AxDSOFramer._DFramerCtlEvents_OnDocumentOpenedEvent e)
 {
     fileName = e.file;
 }
Пример #5
0
 private void framerControl_OnDocumentOpened(object sender, AxDSOFramer._DFramerCtlEvents_OnDocumentOpenedEvent e)
 {
     if (e.file != _docPath)
     {
         _docPath = e.file;
         Changed = true;
     }
 }
Пример #6
0
 private void framerControl_OnFileCommand(object sender, AxDSOFramer._DFramerCtlEvents_OnFileCommandEvent e)
 {
     if (e.item == DSOFramer.dsoFileCommandType.dsoFileSaveAs || e.item == DSOFramer.dsoFileCommandType.dsoFileSave)
     {
         Changed = true;
         SaveDocument();
         e.cancel = true;
     }
 }
Пример #7
0
 void axFramerControl1_BeforeDocumentClosed(object sender, AxDSOFramer._DFramerCtlEvents_BeforeDocumentClosedEvent e) {
     //(e.document as Word.Document).Application.DocumentChange -= new Microsoft.Office.Interop.Word.ApplicationEvents4_DocumentChangeEventHandler(Application_DocumentChange);
     
 }
Пример #8
0
        void axFramerControl1_BeforeDocumentSaved(object sender, AxDSOFramer._DFramerCtlEvents_BeforeDocumentSavedEvent e) {

        }
Пример #9
0
        void axFramerControl1_OnDocumentOpened(object sender, AxDSOFramer._DFramerCtlEvents_OnDocumentOpenedEvent e) {
            this.dsoFramerWordControl1.FileSave();
            rowData.DocContent = this.dsoFramerWordControl1.FileDataGzip;
            uCmExcel1.ParentObj = rowData;

        }