Пример #1
0
 public void Highlight(Parser parser)
 {
     try
     {
         this.Application.ScreenUpdating = false;
         var sel = this.Application.Selection;
         if (sel is ExcelInterop.Range)
         {
             // Highlight cells
             HighlightCells(sel, parser);
         }
         else
         {
             // Highlight shapes
             foreach (ExcelInterop.Shape shape in sel.ShapeRange)
             {
                 if (shape.TextFrame2.HasText == Office.MsoTriState.msoTrue)
                     HighlightTextRange(shape.TextFrame2.TextRange, parser);
             }
         }
     }
     finally
     {
         this.Application.ScreenUpdating = true;
     }
 }
Пример #2
0
        public void Highlight(Parser parser)
        {
            var sel = this.Application.ActiveWindow.Selection;
            if (sel.ShapeRange.Count == 1)
            {
                    HighlightTextRange(sel.TextRange2, parser);
            }
            else
            {
                foreach (PowerPointInterop.Shape shape in sel.ShapeRange)
                {
                    if (shape.HasTextFrame == Office.MsoTriState.msoTrue)
                        HighlightTextRange(shape.TextFrame2.TextRange, parser);
                }

            }
        }