You can have a look at docx4j The site says:
docx4j is a Java library for creating and manipulating Microsoft Open XML (Word docx, Powerpoint pptx, and Excel xlsx) files.
Or, Apache POI. The site says:
The Apache POI Project's mission is to create and maintain Java APIs for manipulating various file formats based upon the Office Open XML standards (OOXML) and Microsoft's OLE 2 Compound Document format (OLE2). In short, you can read and write MS Excel files using Java.
One of the two should suffice. Since you are only concerned with docx
, go for the first. If there are multiple formats, go for the second.