Zend certified PHP/Magento developer

Batch convert docx files to pdf

I have many DOCX files (of Office 365) that I need to convert to PDF. I can open each one of them and export to PDF, but I am looking for a faster solution that can run in a batch file.
One option that almost works is to use LibreOffice as explained here. It works for simple docx files, but for more complex files (e.g. with images and rtl text) it messes up the layout of the file.
Is there a way to do the same with MS Word?