- Code: Select all
P docx4jParagraph = factory.createP();
R run = factory.createR();
docx4jParagraph.getContent().add(run);
pPr pPr = new PPr();
PStyle style = factory.createPPrBasePStyle();
style.setVal(styleID);
pPr.setPStyle(style);
as styleID I pass the String "berschrift1". Which I also can find in the styles.xml :
<w:style w:type="paragraph" ...