protected void handleMacro() throws IOException, SAXException {

        byte[] bytes = macroBuffer.toString().getBytes(StandardCharsets.UTF_8);

        if (embeddedDocumentExtractor == null) {
            embeddedDocumentExtractor =
                    EmbeddedDocumentUtil.getEmbeddedDocumentExtractor(parseContext);
        }
        Metadata embeddedMetadata = new Metadata();
        if (!StringUtils.isBlank(macroName)) {
            embeddedMetadata.set(TikaCoreProperties.RESOURCE_NAME_KEY, macroName);
        }
        embeddedMetadata.set(TikaCoreProperties.EMBEDDED_RESOURCE_TYPE,
                TikaCoreProperties.EmbeddedResourceType.MACRO.toString());

        if (embeddedDocumentExtractor.shouldParseEmbedded(embeddedMetadata)) {
            try (TikaInputStream tis = TikaInputStream.get(bytes)) {
                embeddedDocumentExtractor
                        .parseEmbedded(tis, contentHandler, embeddedMetadata, true);
            }
        }
    }
Handler for macros in flat open documents
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-miscoffice-module/src/main/java/org/apache/tika/parser/odf/FlatOpenDocumentMacroHandler.java