IWPTextCursor.MoveToField

[Top]  [Chapter]  [Previous]  [Next]

Applies to

IWPTextCursor

Declaration

bool MoveToField( string Name,  int Mode, int Option);

 

This is a versatile methods to jump to and between mail merge fields:

 

Mode = 0:

Locate the first field in the text, or the first field with the provided name if parameter "name" was not empty.

 

Mode = 1:

Locate the next field in the text, or the next field with the provided name if parameter "name" was not empty.

 

Mode = 2:

Locate previous field

 

Mode = 3

Locate the last field

 

If bit 1 was set in parameter "option" the cursor will be positioned after the field object.

 

This example will move to all fields (from current position) and select the text.

 

if(wpdllInt1.Memo.TextCursor.MoveToField("",1,1))

           wpdllInt1.Memo.CurrObj.Select(2)


[iwptextcursor_movetofield.htm]    Copyright © 2007 by WPCubed GmbH