// /* Replace text directly */
// int count = wordDoc.getRange().replace("DATE_DEP_AFF_FAX",
// "DOMINIQUE", true, true);
// System.out.printf("%s items replaced !\n", count);
/* Replace text fields */
FormFields formFields = wordDoc.getRange().getFormFields();
for (int i = 0; i < formFields.getCount(); i++) {
FormField formField = formFields.get(i);
String value = "VALUE_" + Integer.toString(i);
System.out.printf("Processing FormFiled['%s'] to ['%s']\n",
formField.getName(), value);
int count = formField.getDocument().getRange().replace(
formField.getName(), value, true, true);