Hello,
Macros can be detected by phpdocx when using DOCX documents. In the case of the old DOC documents, maybe you can transform DOC to DOCX using the conversion plugin (https://www.phpdocx.com/api-documentation/format-conversion/convert-Word-docx-into-pdf-with-PHP) and then use phpdocx to check if the DOCX contains macros.
If you send to contact[at]phpdocx.com a DOC document sample you are using, we'll check it.
Regards.