Convert dot to dotx in JAVA

596 Views Asked by At

I have a .dot file using which i will be creating doc file with values replaced.

eg: .dot file having <claimId>

I will replace <claimId> with real claim Id say 1234 and generate a doc file. I am using Apache POI HWPFDocument, when using HWPFDocument i am getting issues when i replace text inside table.

So i tried XWPFDocument i can feed only .dotx files.

I have no issue when using dotx file with XWPFDocument and successfully generated docx files. Now i need to convert .dot files to .dotx files from java. Can someone help me on this...

1

There are 1 best solutions below

1
centic On

There is no automated way to do this conversion in Apache POI as far as I know.

You can manually convert .dot files to .dotx by opening the file in Microsoft Word and saving it in the newer format.