I can successfully manipulate fields in the header and footer sections of a DOCX document with TinyButStrong (TBS) through this code:
$TBS->PlugIn(OPENTBS_SELECT_HEADER);
$TBS->MergeField('abk', 'ainfo', true);
$TBS->PlugIn(OPENTBS_SELECT_FOOTER);
$TBS->MergeField('abk', 'ainfo', true);
However, this does not work with an ODT file that is just the DOCX file saved in a different format through LibreOffice.
I found out that I can make it work by manually selecting the enclosed file "style.xml", but this seems not the right way to do it as it does not address a document section in the abstract sense:
$TBS->PlugIn(OPENTBS_SELECT_FILE, 'styles.xml');
$TBS->MergeField('abk', 'ainfo', true);
Does anybody have a better solution?