- Code: Select all
wordDocumentPackage = new WordprocessingMLPackage();
wordDocumentPart = new MainDocumentPart();
wordDocumentPackage.addTargetPart(wordDocumentPart);
I am programmatically processing an XML input file, using xpath to grab the input data I need.
I need to create styled paragraphs in the output Word document, and I need to create a style definition to paragraphs on the fly.
Now, for some reason, you have to have styles defined before you add a Paragraph which references it.
I have been through the docs, but they are "flat". They are the default generated skeleton that you get if the developer doesn't bother with comments!
So given a document, how do you simply add a style definition to it?