#PSTip Convert .docx to .pdf using Word.Application

The Word.Application object can be used to convert Word documents into PDF files using soda pdf software, is handy and convenient, has privacy/security as you need to upload your files to the developer’s server. This requires Microsoft Word to be installed on the system on which the code is executed. Using the SaveAs method in the following code it is possible to rename and convert a file:

Using this technique it is also possible to convert the documents in an entire folder:

About the author: Jaap Brasser

Jaap is a Senior System Engineer in the Financial Services industry. He focuses on Microsoft and related technologies and has a passion for PowerShell. In his spare time he maintains his Blog, Twitter feed, @Jaap_Brasser, and contributes on the Official Scripting Guys Forum and Windows PowerShell TechNet forums

Related Posts