When I generate a document which uses a character style (e.g. Hyperlink) I can’t then modify the style in the generated document. Doing so crashes Microsoft Word 2003. To reproduce the issue you can run the following code:
Document document = new Document();
DocumentBuilder builder = new DocumentBuilder(document);
builder.getFont().setStyleName("Hyperlink");
builder.write("ThisIsALink");
document.save("/temp/generated.doc");
The generated document can then be opened in Microsoft Word and the content is as expected and styled correctly. In Microsoft Word then go to Format -> Styles and Formatting. Right click on the Hyperlink style and select Modify. At this point Word will crash.
This happens when you try and modify any character style that has been used in the generated document.
Any help on how to work around or solve this issue would be appreciated.