title: Is there a Java API that can create rich Word documents?
body: <p>I have a new app I'll be working on where I have to generate a Word document that contains tables, graphs, a table of contents and text.  What's a good API to use for this?  How sure are you that it supports graphs, ToCs, and tables?  What are some hidden gotcha's in using them?</p>
  
  <p>Some clarifications:</p>
  
  <ul>
  <li>I can't output a PDF, they want a Word doc.</li>
  <li>They're using MS Word 2003 (or 2007), not OpenOffice</li>
  <li>Application is running on *nix app-server</li>
  </ul>
  
  <p>It'd be nice if I could start with a template doc and just fill in some spaces with tables, graphs, etc.</p>
  
  <p>Edit: Several good answers below, each with their own faults as far as my current situation.  Hard to pick a "final answer" from them.  Think I'll leave it open, and hope for better solutions to be created.</p>
  
  <p>Edit: The OpenOffice UNO project does seem to be closest to what I asked for.  While POI is certainly more mainstream, it's too immature for what I want.</p>