Question: How to create a Word Document using Apache POI?

I am developing a Resume Editor for Atlassian Confluence as Commercial Plugin.

I am sorry I had to ask this but I do not find tutorials witch can help me.

Answer: 
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](http://svn.apache.org/repos/asf/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/)
* Javadoc [HWPFDocument](http://poi.apache.org/apidocs/org/apache/poi/hwpf/HWPFDocument.html)
* Javadoc [org.apache.poi.hwpf.usermodel](http://poi.apache.org/apidocs/org/apache/poi/hwpf/usermodel/package-summary.html)

**XWPF Reference(.docx):** Examples from Apache POI SVN Repo

* [SimpleDocument.java](http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xwpf/usermodel/examples/SimpleDocument.java)
* [SimpleImages.java](http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xwpf/usermodel/examples/SimpleImages.java)
* [SimpleTable.java](http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xwpf/usermodel/examples/SimpleTable.java)
* [UpdateEmbeddedDoc.java](http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xwpf/usermodel/examples/UpdateEmbeddedDoc.java)

And also refer POI [Javadocs](http://poi.apache.org/apidocs/org/apache/poi/xwpf/usermodel/package-summary.html) for XWPF (Word Document).

I hope it will provide startup for you!
```
package org.poi.images;

import java.io.File;   
  import java.io.FileOutputStream;   
  import org.apache.poi.xwpf.usermodel.XWPFDocument;   
  import org.apache.poi.xwpf.usermodel.XWPFParagraph;   
  import org.apache.poi.xwpf.usermodel.XWPFRun;   
  public class DocFile {   
    public void newWordDoc(String filename, String fileContent)   
         throws Exception {   
       XWPFDocument document = new XWPFDocument();   
       XWPFParagraph tmpParagraph = document.createParagraph();   
       XWPFRun tmpRun = tmpParagraph.createRun();   
       tmpRun.setText(fileContent);   
       tmpRun.setFontSize(18);   
       FileOutputStream fos = new FileOutputStream(new File("C:\\Users\\amitabh\\Pictures\\pics\\"+filename + ".doc"));   
       document.write(fos);   
       fos.close();   
    }   
    public static void main(String[] args) throws Exception {   
         DocFile app = new DocFile();   
         app.newWordDoc("testfile", "Hi hw r u?");   

    }   
  }   

```