If you do have Word installed, then you will have to obey its AppleScript dictionary for opening and exporting Word documents to PDF. There may also be some Automator actions installed by Word that handle this for you. I don't have any Microsoft Office for Mac installed so cannot confirm what is, and is not available.
If you do not have MS Word installed, then the next best conversion solution would be to use the command-line feature of the free LibreOffice Suite to batch convert Word .doc/x into PDF.
I have a Bash shell function setup that allows me to convert one or more specified Word files to PDF using LibreOffice:
to_pdf ()
{
for file in "$@";
do
if [ -s $file ]; then
/Applications/LibreOffice.app/Contents/MacOS/soffice --headless --convert-to pdf "${file}";
else
printf "\n%s\n\n" ">>> $file not found or zero length.";
continue;
fi;
done
}
Using the above Bash function on the Terminal command-line, the following three Word files will be converted to PDF in the same location as the unchanged original documents. This will also work for other documents that LibreOffice knows how to open. The LibreOffice application itself does not visually appear during this process.
$ to_pdf foo.doc foobar.docx this.docx
Here is an Automator Service that expects LibreOffice installation, and accepts selected Word .doc/x files in the Finder. It converts them to PDF in the original document location. You can single-click on this to slightly enlarge, or right-click and download the image which will be more visible.
