Move cursor (W)

Modified on Mon, 5 Oct at 1:54 PM

Sometimes when configuring functionality that insert or remove content from Word, it is handy to be able to correct the location of the cursor. These commands can be used in conjunction with such functionality and allows us to define the direction and number of characters to move.

Move Cursor

Move the cursor either left or right a defined number of places.

CMD

<Cmd case="BaseExtensions:move-cursor" direction="X" count="Y"/>

Parameters

direction

Define which direction the cursor should be moved. This can be either Right or Left.

count

Define the number of characters to move the cursor. If selection is multiple characters marked, the move will then use one character to 'collapse' to either the end of selection (if direction is set to Right) or the beginning of selection (if direction is set to Left).

Expand Selection

This command expands the current selection. It can be used in conjunction with the above command to more accurately place the cursor in a specific location. For example, using this command to select an entire paragraph, then the BaseExtensions:move-cursor command to move the cursor one place to the left will ensure the cursor is placed at the beginning of a paragraph.

CMD

<Cmd case="BaseExtensions:expand-selection" unit="x"/>

Parameters

unit

Defines what unit the selection should be expanded to include. This command takes the WdUnits enumerator values as values. More can be read about these here.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article