Posted: 20 Apr 2017 16:20 EDT Last activity: 23 Jan 2018 6:21 EST
Convert a Word Document into a PDF Using a Script
Below is a script you may use to convert any file that can be opened via Microsoft Word into a PDF. I have tested it with a txt file as well as an actual Word document, however other types may work as well. It requires a reference be added to the script component. You must add a reference to Microsoft.Office.Interop.Word. The script accepts a path to your file and creates a PDF file of the same name in the same location (it will return this value). The script code is below, however it is also attached as a text file.
Parameters: string fileName
Result type: string