I needed a way to generate PDFs of Word documents automatically for a custom Office worker I was making for Windchill. The following script will show you the core code to due such a thing.
The WordPDF script below automates the task of converting Word readable documents to PDFs.
For my Windchill Document Worker, I needed a way to convert Word documents to PDFs via the command line. Using Word to do this would prevent any kind of format translation errors that are often in other free programs that can open Word documents.
Apparently, this is a very easy thing to do so I will spare you the boring details and let the script speak for itself.
You can easily add a ForEach loop to go through all documents in a given directory and convert them to PDFs. I didn't need to do such a thing for my purposes as I am only provided a single file at a time so I will leave that little piece up to you to figure out. =)