You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by mviv <mv...@gmail.com> on 2010/05/03 15:03:46 UTC

Drop down form field in Word doc

How can I read a drop down form field from a Word document?
When I try to do this, the TextPiece contains FORMDROPDOWN without the
selected value. How can I get the value that is selected in the drop down?

Thanks.
-- 
View this message in context: http://old.nabble.com/Drop-down-form-field-in-Word-doc-tp28434950p28434950.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Drop down form field in Word doc

Posted by MSB <ma...@tiscali.co.uk>.
I suspect that somewhere in the binary file there is a data structure that
contains all of the text associated with the drop down along with the value
the user selected. This is most likely linked back to the area in the
document where it should appear using a pointer but I do not know this to be
the case and the annoying thing is that the document Microsoft produced does
not really describe in complete detail how to get at all of these values.

HWPF is still an immature API because the original lead developer signed a
non-disclosure agreement with Microsoft when they accepted a new job. As a
result, they cannot even comment on questions about the API and, naturally,
development of the code stalled at quite an early stage. Over time, HWPF has
become a little neglected, hence my dropping the hint about it needing new
developers willing to take on the challenge of pushing the api forward.

Yours

Mark B


mviv wrote:
> 
> Thanks for your inputs Mark.
> I am using HWPF to read a .doc file (Office 2003 format).
> I was not able to find anything concrete (in the API docs or on this
> forum) regarding this feature. I wanted to ensure that I am not missing
> something and using the API as expected. All the FORMTEXT fields in the
> TextPiece do have the associated text. It's FORMDROPDOWN which is causing
> problem for me right now.
> 
> Regards,
> Vivek
> 
> 
> MSB wrote:
>> 
>> Which version of the file format are you targetting please, the binary
>> (.doc) files with HWPF or the xml based (.docx) files with XWPF?
>> 
>> I have to say that I do not know that this is the case but I do very much
>> doubt that it is possible to do what you require. HWPF is an immature api
>> that is in need of developers - hint! - and it will not be a trivial task
>> to add the required functionality I suspect. XWPF will, if it does not
>> already include the necessary support, be much easier to fix as the file
>> format is better documented and more accessible.
>> 
>> Either way, it would be wonderful if you would consider adding this
>> feature into the api - assuming that I am correct and it does not exist -
>> and contributing the work to the project.
>> 
>> Yours
>> 
>> Mark B
>> 
>> 
>> mviv wrote:
>>> 
>>> How can I read a drop down form field from a Word document?
>>> When I try to do this, the TextPiece contains FORMDROPDOWN without the
>>> selected value. How can I get the value that is selected in the drop
>>> down?
>>> 
>>> Thanks.
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Drop-down-form-field-in-Word-doc-tp28434950p28443777.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Drop down form field in Word doc

Posted by mviv <mv...@gmail.com>.
Thanks for your inputs Mark.
I am using HWPF to read a .doc file (Office 2003 format).
I was not able to find anything concrete (in the API docs or on this forum)
regarding this feature. I wanted to ensure that I am not missing something
and using the API as expected. All the FORMTEXT fields in the TextPiece do
have the associated text. It's FORMDROPDOWN which is causing problem for me
right now.

Regards,
Vivek


MSB wrote:
> 
> Which version of the file format are you targetting please, the binary
> (.doc) files with HWPF or the xml based (.docx) files with XWPF?
> 
> I have to say that I do not know that this is the case but I do very much
> doubt that it is possible to do what you require. HWPF is an immature api
> that is in need of developers - hint! - and it will not be a trivial task
> to add the required functionality I suspect. XWPF will, if it does not
> already include the necessary support, be much easier to fix as the file
> format is better documented and more accessible.
> 
> Either way, it would be wonderful if you would consider adding this
> feature into the api - assuming that I am correct and it does not exist -
> and contributing the work to the project.
> 
> Yours
> 
> Mark B
> 
> 
> mviv wrote:
>> 
>> How can I read a drop down form field from a Word document?
>> When I try to do this, the TextPiece contains FORMDROPDOWN without the
>> selected value. How can I get the value that is selected in the drop
>> down?
>> 
>> Thanks.
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Drop-down-form-field-in-Word-doc-tp28434950p28436982.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Drop down form field in Word doc

Posted by MSB <ma...@tiscali.co.uk>.
Which version of the file format are you targetting please, the binary (.doc)
files with HWPF or the xml based (.docx) files with XWPF?

I have to say that I do not know that this is the case but I do very much
doubt that it is possible to do what you require. HWPF is an immature api
that is in need of developers - hint! - and it will not be a trivial task to
add the required functionality I suspect. XWPF will, if it does not already
include the necessary support, be much easier to fix as the file format is
better documented and more accessible.

Either way, it would be wonderful if you would consider adding this feature
into the api - assuming that I am correct and it does not exist - and
contributing the work to the project.

Yours

Mark B


mviv wrote:
> 
> How can I read a drop down form field from a Word document?
> When I try to do this, the TextPiece contains FORMDROPDOWN without the
> selected value. How can I get the value that is selected in the drop down?
> 
> Thanks.
> 

-- 
View this message in context: http://old.nabble.com/Drop-down-form-field-in-Word-doc-tp28434950p28436581.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org