Your attached code file “DownloadAsMicrosoftWordDocument.java.txt” has a coding for file download functionality; no Word document creation.
As you looking for Word Document creation, please find references below:
HWPF Reference(.doc): POI trunk doesn’t have examples as XWPF do, However POI Scratchpad has Testcases around it, please find
- POI Scratchpad
- Javadoc HWPFDocument
- Javadoc org.apache.poi.hwpf.usermodel
XWPF Reference(.docx): Examples from Apache POI SVN Repo
And also refer POI Javadocs for XWPF (Word Document).
I hope it will provide startup for you!