MoveWord Method (Cursor)

Build 1501 on 14/Nov/2017  This topic last edited on: 23/Mar/2016, at 12:25

Description

Moves the cursor of the specified number of words to the right (to the left if the number is negative).

Returns 0 if successful, otherwise it returns the number of positions NOT moved yet (e.g. if the cursor is one word before the end of the text a Move(3) call will move the cursor to the right by 1 word - to the end of the text - and return 2 = 3 - 1).

See also MoveCell Method and Move Method.

Syntax

dim NotMoved as Long = object.MoveWord (nOffset)

object

Required. Object name, returned by Text.GetCursor(...).

nOffset

Integer. If positive, number of words to move right; if negative, number of words to move left

Example

This returns 0 if the word is not the last one in the text, or 1 if the word is the last one, thus the cursor cannot be moved to the right.

Dim objCur = Text.GetCursor(modeSame,cposCursor,True)

msgbox (objCur.MoveWord(1))

For the meaning of the standard constants see Constants related to Cursor and TxtPosDesc object.