If I need create an macro-enabled document, I do something like this:
- Code: Select all
WordprocessingMLPackage wmlPack = WordprocessingMLPackage.createPackage();
wmlPack.getMainDocumentPart().setContentType(new ContentType(ContentTypes.WORDPROCESSINGML_DOCUMENT_MACROENABLED));
wmlPack.save(new File("withMacro.docm"));
My problem is, that in file [Content_Types].xml I expect this:
, but in real I find there this:<Override PartName="/word/document.xml" ContentType="application/vnd.ms-word.document.macroEnabled.main+xml" />
<Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml" />
What I am doing wrong, please?
Thank you very much.