{"id":3568,"date":"2026-11-18T10:00:45","date_gmt":"2026-11-18T09:00:45","guid":{"rendered":"https:\/\/digitalia.culturanuova.net\/blog\/?p=3568"},"modified":"2026-11-21T10:27:02","modified_gmt":"2026-11-21T09:27:02","slug":"annoying-macro-in-librewriter","status":"publish","type":"post","link":"https:\/\/digitalia.culturanuova.net\/blog\/?p=3568","title":{"rendered":"Removing an embedded macro from an old ODT"},"content":{"rendered":"\n<p>You may occasionally find that an old ODT file contains an embedded macro that you cannot get rid of through LibreOffice Writer&#8217;s graphical interface.<\/p>\n\n\n\n<p>Nor does saving the document as DOCX or RTF and then converting it back to ODT necessarily solve the problem.<\/p>\n\n\n\n<p>In this case, you can try the following workaround.<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Extract <code>content.xml<\/code> from your ODT file (e.g. using Ark, the KDE archive manager).<\/li>\n\n\n\n<li>If you cannot work with the file because all its contents are on a single line, you can format the XML using this command:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>xmllint --format content.xml -o content.xml<\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>Search for the macro-related event binding, typically in a block like this:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;text:execute-macro&gt;\n    &lt;office:event-listeners&gt;\n        ...\n    &lt;\/office:event-listeners&gt;\n&lt;\/text:execute-macro&gt;<\/code><\/pre>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li>Delete the relevant block and save <code>content.xml<\/code>.<\/li>\n\n\n\n<li>Replace the original <code>content.xml<\/code> in the ODT archive with the modified version (remove the old one first).<\/li>\n<\/ol>\n\n\n\n<p>That&#8217;s it!<\/p>\n\n\n\n<p><strong>Important:<\/strong> Make a backup copy of your original ODT file before starting.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You may occasionally find that an old ODT file contains an embedded macro that you cannot get rid of through LibreOffice Writer&#8217;s graphical interface. Nor does saving the document as DOCX or RTF and then converting it back to ODT necessarily solve the problem. In this case, you can try the following workaround. That&#8217;s it! &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/digitalia.culturanuova.net\/blog\/?p=3568\" class=\"more-link\">Leggi tutto<span class=\"screen-reader-text\"> &#8220;Removing an embedded macro from an old ODT&#8221;<\/span><\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[723],"tags":[208,115],"class_list":["post-3568","post","type-post","status-publish","format-standard","hentry","category-writer","tag-macro","tag-odt"],"_links":{"self":[{"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3568","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3568"}],"version-history":[{"count":3,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3568\/revisions"}],"predecessor-version":[{"id":3572,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3568\/revisions\/3572"}],"wp:attachment":[{"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}