Known limitations (not a concern of this bug report): - Writer doesn't handle VBA macros. - It doesn't even preserve macros (seems like section "You can choose to preserve or delete VBA macros" in [1] is not valid for newer, OOXML formats, at least in Writer). Open and save the attached files in Writer. Both are DOCMs created in Word 2013, one has macro, the other doesn't. Open the roundtripped file in Word. => Word gives an error: "We're sorry. We can't open <file name> because we found a problem with its contents." The file can only be opened after renaming it to have .DOCX extension. One particular difference is that in the original archive /word/document.xml has ContentType "application/vnd.ms-word.document.macroEnabled.main+xml", while in the roundtripped file it's "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml". Observed with 5.4beta1 and 4.0.0.3 / Windows 7. [1] https://help.libreoffice.org/Common/Using_Microsoft_Office_and
Created attachment 133753 [details] DOCM with macro
Created attachment 133754 [details] DOCM with no macro
Interestingly, just changing the ContentType in [Content_Types].xml is sufficient for Word to import this for me without problems, even with the docm suffix. Presumably this is reasonably easy to do - I'll take a look.
Hi Miklos, Any chance you can take a look ? the quick / horrible hack is to add to: DocxExportFilter::exportDocument a quick check for .docm at the end of getFileUrl() - but that, while functional would be pretty nasty I think. I imagine the best way is to add a 'Macro' variant of OOXML - complete with filter fragments, etc. and to update the oox/source/core/filterdetect.cxx to detect that, and so on (?) - that should let us manually save in that format as well. Clearly this also needs doing for XLSM / PPTM as well - albeit at a lower urgency for C'bra. Thanks ! Michael.
<https://gerrit.libreoffice.org/#/c/38298/> adds a docm filter, then it's easy to act accordingly in the export code. I checked that the oox filter detection already differentiates for xlsx/xlsm. For pptx/pptm I would suggest to use a follow-up bug.
https://gerrit.libreoffice.org/gitweb?p=core.git;a=commitdiff;h=697173f6fdfae581022cfdb5ec5171c5a3be58f0 fixes this on master, just forgot to mention the bug number in the commit message.
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-5-4": http://cgit.freedesktop.org/libreoffice/core/commit/?id=0e6ecd59ec0767fc74cec37512bacaabc3cd1f9d&h=libreoffice-5-4 tdf#108269 sw: add separate DOCM filter It will be available in 5.4.0.1. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=97fa7024ce608b7908aca369e8c643a5de9ebf78 Related: tdf#108269 oox: allow recovering broken DOCM files It will be available in 5.5.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=8a59b30bb1af55f7afd8b98e4b60234f98d84c76 Related: tdf#108269 DOCM filter: preserve VBA stream It will be available in 5.5.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-5-4": http://cgit.freedesktop.org/libreoffice/core/commit/?id=32f45f1bca454659d17dea80499b635a43ae4490&h=libreoffice-5-4 Related: tdf#108269 oox: allow recovering broken DOCM files It will be available in 5.4.0.1. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=1c768b975827c74e58944b8b12ab254891389edc Related: tdf#108269 oox: ignore case when checking .docm extension It will be available in 5.5.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-5-4": http://cgit.freedesktop.org/libreoffice/core/commit/?id=81451bb88855e575fc9a2f5c1e91254c15f07cb9&h=libreoffice-5-4 Related: tdf#108269 oox: ignore case when checking .docm extension It will be available in 5.4.0.1. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-5-4": http://cgit.freedesktop.org/libreoffice/core/commit/?id=35c3dfddf9933809525540d02484c2754510f6d9&h=libreoffice-5-4 Related: tdf#108269 DOCM filter: preserve VBA stream It will be available in 5.4.0.1. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=e4adb8d9e77bab353dda26375e11a6b7a456368f Related: tdf#108269 DOCM filter: reuse oox code for VBA preservation It will be available in 5.5.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=0129c2cd9dd95355412b194c595f4b986403ba1e Related: tdf#108269 DOCM filter: reuse oox code for VBA data preservation It will be available in 5.5.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-5-4": http://cgit.freedesktop.org/libreoffice/core/commit/?id=9af01c56237b716c7f3bfe4664fd1ca1cd87edde&h=libreoffice-5-4 Related: tdf#108269 DOCM filter: reuse oox code for VBA preservation It will be available in 5.4.0.1. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-5-4": http://cgit.freedesktop.org/libreoffice/core/commit/?id=538186004a1201f4881a64cdf5d905a24f86bfb1&h=libreoffice-5-4 Related: tdf#108269 DOCM filter: reuse oox code for VBA data preservation It will be available in 5.4.0.1. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.