Ejemplo n.º 1
0
        /// <summary>
        /// Performs tasks after a redaction has been completed (succesfully or not).
        /// </summary>
        /// <param name="Result">Specifies the results of the redaction attempt.</param>
        private void DoPostRedactionTasks(RedactResult Result)
        {
            Word.Document    Document    = Result.Document;
            Word.Application Application = Document.Application;

            if (Result.Succeeded)
            {
                //post redaction tasks
                Document.Fields.Update(); //make sure any reference fields have the redacted results
                Document.Application.ActiveWindow.View.Type = Microsoft.Office.Interop.Word.WdViewType.wdPrintView;
                Document.Saved = true;

                //finally, blast the undo stack
                Document.UndoClear();

                Document.Application.ScreenUpdating = true;
                Document.Application.ScreenRefresh();

                this.DialogResult = DialogResult.OK;
            }
            else
            {
                Document.Application.ScreenUpdating = true;
                Document.Application.ScreenRefresh();

                ((Word._Document)Document).Close(ref False, ref Missing, ref Missing);

                this.DialogResult = DialogResult.Abort;
            }

            Application.System.Cursor = Word.WdCursorType.wdCursorNormal;

            //close the dialog
            CloseDialog();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// import table from pde into pdw directly from excel add-in
        /// </summary>
        /// <param name="eRange"></param>
        /// <param name="wDoc"></param>
        public void ImportPdeTable(Excel.Range eRange, Word.Document wDoc)
        {
            eRange.Copy();
            wDoc.Application.Selection.PasteExcelTable(true, false, false);

            // to switch show value/lin
            //k press Alt + F9. (ShowFieldCodes = false/true)
            wDoc.ActiveWindow.View.ShowFieldCodes = false;
            System.Windows.Forms.Clipboard.Clear();
            wDoc.UndoClear();
        }