Hi
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thanks for your inquiry. Aspose.Words for Java supports DOCX format starting from 2.6.0 version. You can download the latest version of Aspose.Words for Java from here:
http://www.aspose.com/community/files/72/java-components/aspose.words-for-java/category1378.aspx
Regarding the second question, you can do it the following way:
1. Create an empty section with Header.
2. Fill this header with data.
3. Protect this section.
All other sections should inherit header from the first section.
Please try using the following code:
// Open template
Document doc = new Document("C:\\Temp\\in.docx");
doc.getMailMerge().execute(new String[] { "Header" }, new Object[] { "MyProtectedHeader" });
// Section protection only works when document protection is turned and only editing in form fields is allowed.
doc.protect(ProtectionType.ALLOW_ONLY_FORM_FIELDS);
// By default, all sections are protected, but we can selectively turn protection off.
doc.getSections().get(0).setProtectedForForms(false);
doc.save("C:\\Temp\\out.docx");
Please see the attached in.docx and output out.docx.
Best regards,