PreviousNext
Help > Programming with LAUNCHER Office > LNCCMD commands > Commands list > WFORMFIELD command
WFORMFIELD command

Allows you to programmatically change the value of a field on a Microsoft Word form. 

 

Syntax

 

CHGVAR

VAR(&CMD) VALUE('WFORMFIELD')

CHGVAR

VAR(&PARM1) VALUE('
Field="Bookmark name"
[;NUMFMT(d DECPOINT=p GRPPOINT=g)]
[;Clear=True/False]
[;AddEntries=True/False]
[;Value=Indice_de_liste]
[;SetText=True/False]
[;GetValue=True/False]
[;GetText=True/False]

')

CHGVAR

VAR(&PARM2) VALUE('[text]')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +

&PARM2 &RESULT)

 

 

 

 

 

 Parameters

 

 

Parameters

 

Parm1

Field : bookmark name from current document.

 

NUMFMT(d DECPOINT=p GRPPOINT= allows to format a decimal digital value.

-d is the decimal position number.

-p indicates which character to use as decimal separator.

-g indicates which character to use as thousand separator.

 

Clear : erase the contents of the field before affecting new value. If the field is a drop-down list, all the entries are erased.

 

AddEntries : add entries in a drop-down list. Parameter 2 (&PARM2) contains the list of the values, between double quotes, and separated by semicolon.

 

Value : change the index of the value in progress in a drop-down list, or in a chek box.

 

If SetText is true, then the contents of parameter 2 will be regarded as a text to assign to the field, and not as the index of the value in progress in a list.
If SetText is false, then the contents of parameter 2 will be regarded as an index, if it is numerical.

 

When GetValue is true, the current index of a drop-down list is returned in the &RESULT parameter.

 

When GetText is true, the value of the field is returned in the &RESULT parameter.

 

Parm2

Text to insert, or list of entries to add to a drop-down list.

 

Example

 

The following example gives to field "FF01" the value of variable &FIELDVAL.

CHGVAR

VAR(&CMD) VALUE('WFORMFIELD)

CHGVAR

VAR(&PARM1) VALUE('Field ="FF01";SetText')

CHGVAR

VAR(&PARM2) VALUE(&FIELDVAL)

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +

&PARM2 &RESULT))

 

The following example fixes the entries of a drop-down list.

CHGVAR

VAR(&CMD) VALUE('WFORMFIELD)

CHGVAR

VAR(&PARM1) VALUE('Field ="FF02";AddEntries')

CHGVAR

VAR(&PARM2) VALUE('"France";"Italie";"Espagne"')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +

&PARM2 &RESULT))

 

The example recovers the value text of a field of form, then erases it.

CHGVAR

VAR(&CMD) VALUE('WFORMFIELD)

CHGVAR

VAR(&PARM1) VALUE('Field="FF03";GetText;Clear')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +

&PARM2 &RESULT))