IWPTextCursor.MoveToField |
[Top] [Chapter] [Previous] [Next] |
Applies to Declaration bool MoveToField( string Name, int Mode, int Option);
This is a versatile methods to jump to and between mail merge fields:
Parameters:
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
Option - Bitfield: If bit 1 was set in parameter "option" the cursor will be positioned inside the field at the start: <|....>
If bit 2 was set in parameter "option" the cursor will be positioned after the end of the field: <....>|
If bit 1 and 2 are set the cursor will be at the end INSIDE the field: <....|>
If Bit 4 and 2 was set, the field will be selected. <....|>
Examples: Select the field and the marker:
wpdllInt1.TextCursor.MoveToField("FELD", 0, 6);
Select only the text of the field:
wpdllInt1.TextCursor.MoveToField("FELD", 0, 7);
This example will move to next field (from current position).
wpdllInt1.Memo.TextCursor.MoveToField("",1,1));
Also see: Memo.TextCommandStr ID 43-46: Delete, Read and Write a field and also Load and Save Category - Formatstrings.
Please also see Category Mailmerge and the "mail merge API introduction". |