Page 1 of 1

Form Field Extraction

PostPosted: Tue Dec 16, 2014 1:50 pm
by cyruswong

I am using FieldRef to extract the MSWord docx form field data.
And, based on the code ...
Or by ...

OutputStream output = new OutputStream() {
private StringBuilder string = new StringBuilder();

public void write(int b) throws IOException {
this.string.append((char) b);

// Netbeans IDE automatically overrides this toString()
public String toString() {
return this.string.toString();

Writer out = new OutputStreamWriter(output);
try {
TextUtils.extractText(fr.getResultsSlot(), out);
} catch (Exception e) {
// TODO Auto-generated catch block
} finally {

I can get the field name, and the first line of data in the text fields.

Do anyone know how to extract text field like?
Actually, I am able to do it in VBA, but no idea how to do it in JAVA. ... _data.html

Attached with the Sample word file and password abcd1234

Hope someone could give me some hits!