Exemple #1
0
        /// <summary>
        /// levels:
        /// 0: para
        /// 1: sent
        /// 2: wrod
        /// 3: char
        /// 4+: return
        /// </summary>
        /// <param name="level"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        public RangeWrapper GetNext(int level, int count)
        {
            WdUnits unitsOfMovement = WdUnits.wdParagraph;

            switch (level)
            {
            case 0:
                unitsOfMovement = WdUnits.wdParagraph;
                break;

            case 1:
                unitsOfMovement = WdUnits.wdSentence;
                break;

            case 2:
                unitsOfMovement = WdUnits.wdWord;
                break;

            case 3:
                unitsOfMovement = WdUnits.wdCharacter;
                break;

            default:
                throw new ArgumentException("level cannot exceed 3");
            }

            return(GetNext(unitsOfMovement, count));
        }
        private void SelectionMoveDown(WdUnits unit, int count, WdMovementType extend)

        {
            RunRoutine(__WordSelection, "MoveDown", new object[3] {
                (int)unit, count, (int)extend
            });
        }
        private void SelectionEndKey(WdUnits unit, WdMovementType extend)

        {
            RunRoutine(__WordSelection, "EndKey", new object[2] {
                (int)unit, (int)extend
            });
        }
        private void SelectionEndKey(WdUnits unit)

        {
            RunRoutine(__WordSelection, "EndKey", new object[1] {
                (int)unit
            });
        }
Exemple #5
0
        public RangeWrapper GetNext(WdUnits units, int count)
        {
            object moveCount       = count;
            object unitsOfMovement = units;

            Range nextRange = m_range.Next(ref unitsOfMovement, ref moveCount);

            if (nextRange == null)
            {
                return(null);
            }

            return(new RangeWrapper(nextRange));
        }
 /// <summary>
 /// Simulates pressing the up arrow key.
 /// </summary>
 /// <param name="unit">Unit to select on</param>
 /// <param name="count">number of presses</param>
 /// <param name="extend">Movement type</param>
 /// <history>
 /// [Curtis_Beard]      07/28/2006  Created
 /// </history>
 private void SelectionMoveUp(WdUnits unit, int count, WdMovementType extend)
 {
     RunRoutine(__WordSelection, "MoveUp", new object[3] { (int)unit, count, (int)extend });
 }
 /// <summary>
 /// Simulates pressing the home key.
 /// </summary>
 /// <param name="unit">Unit to select on</param>
 /// <param name="extend">Movement type</param>
 /// <history>
 /// [Curtis_Beard]      07/28/2006  Created
 /// </history>
 private void SelectionHomeKey(WdUnits unit, WdMovementType extend)
 {
     RunRoutine(__WordSelection, "HomeKey", new object[2] { (int)unit, (int)extend });
 }
 /// <summary>
 /// Simulates pressing the home key.
 /// </summary>
 /// <param name="unit">Unit to select on</param>
 /// <history>
 /// [Curtis_Beard]      07/28/2006  Created
 /// </history>
 private void SelectionHomeKey(WdUnits unit)
 {
     RunRoutine(__WordSelection, "HomeKey", new object[1] { (int)unit });
 }