Activate() public method

public Activate ( ) : void
return void
Example #1
0
        void UpdateCurrentDocumentController()
        {
            var activeDocument = GetActiveDocument();

            if (activeDocument == null)
            {
                Debug.WriteLine("UpdateCurrentDocumentController(): No active Document.");
                currentDocumentController = null;
                addinModule.UpdateState(null);
                return;
            }

            Debug.WriteLine("WindowCount=" + wordApp.Application.Windows.Count);

            Debug.WriteLine("UpdateCurrentDocumentController(): Updating current");
            currentDocumentController = GetControllerForDocument(activeDocument);
            currentDocumentController.Activate();

            currentDocumentController.Document.Application.ScreenUpdating = false;
            try
            {
                addinModule.SetSelectedStyle(currentDocumentController.Style ?? DefaultStyle);

                addinModule.UpdateState(new SelectionManager(currentDocumentController));
            }
            finally
            {
                currentDocumentController.Document.Application.ScreenUpdating = true;
            }
        }
Example #2
0
        void UpdateCurrentDocumentController()
        {
            var activeDocument = GetActiveDocument();
            if (activeDocument == null)
            {
                Debug.WriteLine("UpdateCurrentDocumentController(): No active Document.");
                currentDocumentController = null;
                addinModule.UpdateState(null);
                return;
            }

            Debug.WriteLine("WindowCount=" + wordApp.Application.Windows.Count);

            Debug.WriteLine("UpdateCurrentDocumentController(): Updating current");
            currentDocumentController = GetControllerForDocument(activeDocument);
            currentDocumentController.Activate();

            currentDocumentController.Document.Application.ScreenUpdating = false;
            try
            {

                addinModule.SetSelectedStyle(currentDocumentController.Style ?? DefaultStyle);

                addinModule.UpdateState(new SelectionManager(currentDocumentController));
            }
            finally
            {
                currentDocumentController.Document.Application.ScreenUpdating = true;
            }
        }