Batch converting word files to PDF

Today I had to convert hundreds of .doc files to .pdf. I first thought it would be impossible because there would be not such option or command line option on MS-Word. But surprisingly, this great tutorial shows how using powerful command line arguments for MS-Word.

From the page above (with a little change):

FOR /F “usebackq delims=” %%g IN (`dir /b “*.doc”`) DO “C:\Program Files\Microsoft Office\OFFICE12\WINWORD.EXE” “%%g” /q /n
/mFilePrintDefault /mFileExit && TASKKILL /f /im winword.exe

this batch will get all the doc files on a directory and convert them to PDF by using the default printer, which is configured to print to PDF files.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s