Tip>Designer>Word Functions

Dynamically move the cursor up

 

Article #:

0005

Contributor:

Joanne Irvine-Smith

GF version:

3.05

Applies to:

Moving the cursor in Microsoft Word

Last updated:

July 10, 2001

Description

Dynamically moves the cursor back up in a document to the position specified.

Explanation

To move the cursor up to a specific point in a document, use the following function in a FillPoint:

WordApp.Selection.MoveUp(Unit,Count,Extend)

 

Click here for a description of each variant.

 

VARIANT

DESCRIPTION

Unit

The unit by which to move the selection. Can be one of the following WdUnits constants: wdLine (5), wdParagraph (4), wdWindow (11) or wdScreen (7). The default value is wdLine.

Count

The number of units the selection is to be moved. The default value is 1.

Extend

Can be either wdMove (0) or wdExtend (1). If wdMove is used, the selection is collapsed to the end point and moved up. If wdExtend is used, the selection is extended up. The default value is wdMove.

 

 

For example:

%[WordApp.Selection.MoveUp(5,8,0)]

will move the cursor up 8 lines.

%[WordApp.Selection.MoveUp(4,1,0)]

will move the cursor to the top of the paragraph.

%[WordApp.Selection.MoveUp(11,1,0)]

will move the cursor to the top of the document.

 

NOTE

  • To move the cursor to the top of the document, you can also use the following Macro:

%[RunMacro('StartOfDocument')].

  • A useful application of this method is to insert it as the last FillPoint in order to move the cursor back to a position where the user can begin editing the document.

Template Example